|
@@ -141,7 +141,10 @@ void FBXImporter::SetupProperties(const Importer *pImp) {
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
// Imports the given file into the given scene structure.
|
|
// Imports the given file into the given scene structure.
|
|
void FBXImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) {
|
|
void FBXImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) {
|
|
- std::unique_ptr<IOStream> stream(pIOHandler->Open(pFile, "rb"));
|
|
|
|
|
|
+ auto streamCloser = [&](IOStream *pStream) {
|
|
|
|
+ pIOHandler->Close(pStream);
|
|
|
|
+ };
|
|
|
|
+ std::unique_ptr<IOStream, decltype(streamCloser)> stream(pIOHandler->Open(pFile, "rb"), streamCloser);
|
|
if (!stream) {
|
|
if (!stream) {
|
|
ThrowException("Could not open file for reading");
|
|
ThrowException("Could not open file for reading");
|
|
}
|
|
}
|