CMaterialSet: Make Clone() return a unique_ptr

Makes the returned pointer leak-free by default.
This commit is contained in:
Lioncash 2020-06-15 14:12:03 -04:00
parent 95f6c3360d
commit 6edea6a225
1 changed files with 2 additions and 2 deletions

View File

@ -17,9 +17,9 @@ public:
CMaterialSet() = default;
~CMaterialSet() = default;
CMaterialSet* Clone()
std::unique_ptr<CMaterialSet> Clone()
{
CMaterialSet *pOut = new CMaterialSet();
auto pOut = std::make_unique<CMaterialSet>();
pOut->mMaterials.resize(mMaterials.size());
for (uint32 iMat = 0; iMat < mMaterials.size(); iMat++)