Lioncash ce315280c3 CResource: Make BuildDependencyTree() return a unique_ptr
Makes the functions more memory safe in terms of freeing memory in
exceptional paths .
2020-06-11 18:39:07 -04:00

26 lines
522 B
C++

#ifndef CMAPAREA_H
#define CMAPAREA_H
#include "CResource.h"
// Barebones class
class CMapArea : public CResource
{
friend class CUnsupportedFormatLoader;
CAssetID mNameString;
public:
explicit CMapArea(CResourceEntry *pEntry = nullptr)
: CResource(pEntry)
{}
std::unique_ptr<CDependencyTree> BuildDependencyTree() const override
{
auto pTree = std::make_unique<CDependencyTree>();
pTree->AddDependency(mNameString);
return pTree;
}
};
#endif // CMAPAREA_H