From af8e297e0fc7c339aa5a3c05aeb1aa8ec5e68c00 Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Sat, 2 Dec 2017 17:10:06 +0200 Subject: [PATCH] BaseImporter: Replace ScopeGuard with std::unique_ptr --- code/BaseImporter.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/BaseImporter.cpp b/code/BaseImporter.cpp index 09b32e3ae..b9b9eeb71 100644 --- a/code/BaseImporter.cpp +++ b/code/BaseImporter.cpp @@ -89,12 +89,12 @@ aiScene* BaseImporter::ReadFile(const Importer* pImp, const std::string& pFile, FileSystemFilter filter(pFile,pIOHandler); // create a scene object to hold the data - ScopeGuard sc(new aiScene()); + std::unique_ptr sc(new aiScene()); // dispatch importing try { - InternReadFile( pFile, sc, &filter); + InternReadFile( pFile, sc.get(), &filter); } catch( const std::exception& err ) { // extract error description @@ -104,8 +104,7 @@ aiScene* BaseImporter::ReadFile(const Importer* pImp, const std::string& pFile, } // return what we gathered from the import. - sc.dismiss(); - return sc; + return sc.release(); } // ------------------------------------------------------------------------------------------------