CMaterialSet: Make Clone() return a unique_ptr
Makes the returned pointer leak-free by default.
This commit is contained in:
parent
95f6c3360d
commit
6edea6a225
|
@ -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++)
|
||||
|
|
Loading…
Reference in New Issue