122243,122194 Resource leak
This commit is contained in:
@@ -172,8 +172,7 @@ void MDLImporter::InternReadFile( const std::string& pFile,
|
||||
}
|
||||
|
||||
// Allocate storage and copy the contents of the file to a memory buffer
|
||||
std::vector<unsigned char> buffer(iFileSize+1);
|
||||
mBuffer = &buffer[0];
|
||||
mBuffer =new unsigned char[iFileSize+1];
|
||||
file->Read( (void*)mBuffer, 1, iFileSize);
|
||||
|
||||
// Append a binary zero to the end of the buffer.
|
||||
@@ -239,7 +238,8 @@ void MDLImporter::InternReadFile( const std::string& pFile,
|
||||
0.f,0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.f,0.f,1.f);
|
||||
|
||||
// delete the file buffer and cleanup
|
||||
AI_DEBUG_INVALIDATE_PTR(mBuffer);
|
||||
delete [] mBuffer;
|
||||
mBuffer= nullptr;
|
||||
AI_DEBUG_INVALIDATE_PTR(pIOHandler);
|
||||
AI_DEBUG_INVALIDATE_PTR(pScene);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user