PyBullet: fix some file leaks.
This commit is contained in:
@@ -141,6 +141,7 @@ bool b3ImportMeshUtility::loadAndRegisterMeshFromFileInternal(const std::string&
|
|||||||
buffer.resize(0);
|
buffer.resize(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fileIO->fileClose(fileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buffer.size())
|
if (buffer.size())
|
||||||
|
|||||||
@@ -10244,6 +10244,7 @@ bool PhysicsServerCommandProcessor::processLoadTextureCommand(const struct Share
|
|||||||
buffer.resize(0);
|
buffer.resize(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fileIO->fileClose(fileId);
|
||||||
}
|
}
|
||||||
if (buffer.size())
|
if (buffer.size())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -579,7 +579,7 @@ std::string LoadMtl(
|
|||||||
// flush last material.
|
// flush last material.
|
||||||
material_map.insert(std::pair<std::string, material_t>(material.name, material));
|
material_map.insert(std::pair<std::string, material_t>(material.name, material));
|
||||||
|
|
||||||
if (fileHandle)
|
if (fileHandle>=0)
|
||||||
{
|
{
|
||||||
fileIO->fileClose(fileHandle);
|
fileIO->fileClose(fileHandle);
|
||||||
}
|
}
|
||||||
@@ -858,7 +858,7 @@ LoadObj(
|
|||||||
}
|
}
|
||||||
faceGroup.resize(0); // for safety
|
faceGroup.resize(0); // for safety
|
||||||
|
|
||||||
if (fileHandle)
|
if (fileHandle>=0)
|
||||||
{
|
{
|
||||||
fileIO->fileClose(fileHandle);
|
fileIO->fileClose(fileHandle);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user