mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-07-01 00:57:56 -05:00
Use unique_ptr for ZoneLoading
This commit is contained in:
@ -2,18 +2,12 @@
|
||||
#include "Zone/Stream/Impl/XBlockInputStream.h"
|
||||
#include <cassert>
|
||||
|
||||
StepLoadZoneContent::StepLoadZoneContent(IContentLoadingEntryPoint* entryPoint, Zone* zone, const int offsetBlockBitCount, const block_t insertBlock)
|
||||
StepLoadZoneContent::StepLoadZoneContent(std::unique_ptr<IContentLoadingEntryPoint> entryPoint, Zone* zone, const int offsetBlockBitCount, const block_t insertBlock)
|
||||
: m_content_loader(std::move(entryPoint)),
|
||||
m_zone(zone),
|
||||
m_offset_block_bit_count(offsetBlockBitCount),
|
||||
m_insert_block(insertBlock)
|
||||
{
|
||||
m_content_loader = entryPoint;
|
||||
m_zone = zone;
|
||||
m_offset_block_bit_count = offsetBlockBitCount;
|
||||
m_insert_block = insertBlock;
|
||||
}
|
||||
|
||||
StepLoadZoneContent::~StepLoadZoneContent()
|
||||
{
|
||||
delete m_content_loader;
|
||||
m_content_loader = nullptr;
|
||||
}
|
||||
|
||||
void StepLoadZoneContent::PerformStep(ZoneLoader* zoneLoader, ILoadingStream* stream)
|
||||
@ -23,4 +17,4 @@ void StepLoadZoneContent::PerformStep(ZoneLoader* zoneLoader, ILoadingStream* st
|
||||
m_content_loader->Load(m_zone, inputStream);
|
||||
|
||||
delete inputStream;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user