From b60d84a8a27a140e7a6ce4eb8b38aa6eab264ca5 Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Sat, 2 Dec 2017 17:23:49 +0200 Subject: [PATCH] C4D: Replace ScopeGuard with std::unique_ptr --- code/C4DImporter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/C4DImporter.cpp b/code/C4DImporter.cpp index 39514f6b8..1344f32fb 100644 --- a/code/C4DImporter.cpp +++ b/code/C4DImporter.cpp @@ -185,11 +185,11 @@ void C4DImporter::InternReadFile( const std::string& pFile, if(mesh->mMaterialIndex >= mat_count) { ++mat_count; - ScopeGuard def_material(new aiMaterial()); + std::unique_ptr def_material(new aiMaterial()); const aiString name(AI_DEFAULT_MATERIAL_NAME); def_material->AddProperty(&name, AI_MATKEY_NAME); - materials.push_back(def_material.dismiss()); + materials.push_back(def_material.release()); break; } } @@ -412,7 +412,7 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) const CPolygon* polys = polyObject->GetPolygonR(); ai_assert(polys != NULL); - ScopeGuard mesh(new aiMesh()); + std::unique_ptr mesh(new aiMesh()); mesh->mNumFaces = static_cast(polyCount); aiFace* face = mesh->mFaces = new aiFace[mesh->mNumFaces](); @@ -616,7 +616,7 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) } mesh->mMaterialIndex = ResolveMaterial(polyObject); - return mesh.dismiss(); + return mesh.release(); }