BaseImporter: Replace ScopeGuard with std::unique_ptr
parent
77b0aa4f4b
commit
af8e297e0f
|
@ -89,12 +89,12 @@ aiScene* BaseImporter::ReadFile(const Importer* pImp, const std::string& pFile,
|
||||||
FileSystemFilter filter(pFile,pIOHandler);
|
FileSystemFilter filter(pFile,pIOHandler);
|
||||||
|
|
||||||
// create a scene object to hold the data
|
// create a scene object to hold the data
|
||||||
ScopeGuard<aiScene> sc(new aiScene());
|
std::unique_ptr<aiScene> sc(new aiScene());
|
||||||
|
|
||||||
// dispatch importing
|
// dispatch importing
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
InternReadFile( pFile, sc, &filter);
|
InternReadFile( pFile, sc.get(), &filter);
|
||||||
|
|
||||||
} catch( const std::exception& err ) {
|
} catch( const std::exception& err ) {
|
||||||
// extract error description
|
// extract error description
|
||||||
|
@ -104,8 +104,7 @@ aiScene* BaseImporter::ReadFile(const Importer* pImp, const std::string& pFile,
|
||||||
}
|
}
|
||||||
|
|
||||||
// return what we gathered from the import.
|
// return what we gathered from the import.
|
||||||
sc.dismiss();
|
return sc.release();
|
||||||
return sc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue