From 28d4e394c0c44dee234d468eb40e90e8359b7a8a Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Fri, 24 Feb 2023 13:17:32 +0200 Subject: [PATCH] Use std::unique_ptr a bit --- code/AssetLib/LWO/LWOLoader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/LWO/LWOLoader.cpp b/code/AssetLib/LWO/LWOLoader.cpp index 96fed248b..75ae6a416 100644 --- a/code/AssetLib/LWO/LWOLoader.cpp +++ b/code/AssetLib/LWO/LWOLoader.cpp @@ -429,7 +429,7 @@ void LWOImporter::InternReadFile(const std::string &pFile, // Generate nodes to render the mesh. Store the source layer in the mParent member of the nodes unsigned int num = static_cast(apcMeshes.size() - meshStart); if (layer.mName != "" || num > 0) { - aiNode *pcNode = new aiNode(); + std::unique_ptr pcNode(new aiNode()); pcNode->mName.Set(layer.mName); pcNode->mParent = (aiNode *)&layer; pcNode->mNumMeshes = num; @@ -439,7 +439,7 @@ void LWOImporter::InternReadFile(const std::string &pFile, for (unsigned int p = 0; p < pcNode->mNumMeshes; ++p) pcNode->mMeshes[p] = p + meshStart; } - apcNodes[layer.mIndex] = pcNode; + apcNodes[layer.mIndex] = pcNode.release(); } }