mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 13:50:04 +00:00
PyBullet: fix some file leaks.
This commit is contained in:
parent
a23cfd0782
commit
d4db50f668
@ -141,6 +141,7 @@ bool b3ImportMeshUtility::loadAndRegisterMeshFromFileInternal(const std::string&
|
||||
buffer.resize(0);
|
||||
}
|
||||
}
|
||||
fileIO->fileClose(fileId);
|
||||
}
|
||||
|
||||
if (buffer.size())
|
||||
|
@ -10244,6 +10244,7 @@ bool PhysicsServerCommandProcessor::processLoadTextureCommand(const struct Share
|
||||
buffer.resize(0);
|
||||
}
|
||||
}
|
||||
fileIO->fileClose(fileId);
|
||||
}
|
||||
if (buffer.size())
|
||||
{
|
||||
|
@ -579,7 +579,7 @@ std::string LoadMtl(
|
||||
// flush last material.
|
||||
material_map.insert(std::pair<std::string, material_t>(material.name, material));
|
||||
|
||||
if (fileHandle)
|
||||
if (fileHandle>=0)
|
||||
{
|
||||
fileIO->fileClose(fileHandle);
|
||||
}
|
||||
@ -858,7 +858,7 @@ LoadObj(
|
||||
}
|
||||
faceGroup.resize(0); // for safety
|
||||
|
||||
if (fileHandle)
|
||||
if (fileHandle>=0)
|
||||
{
|
||||
fileIO->fileClose(fileHandle);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user