Skip to content

Commit

Permalink
fix potential memory leak in createMultiBody, reported by Fei Xia her…
Browse files Browse the repository at this point in the history
…e (thanks for report/repro!)

bulletphysics#2898
  • Loading branch information
erwincoumans committed Aug 13, 2020
1 parent ff229ba commit 306245d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/SharedMemory/PhysicsServerCommandProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2521,6 +2521,17 @@ struct ProgrammaticUrdfInterface : public URDFImporterInterface
}
}
}

//delete textures
for (int i = 0; i < textures.size(); i++)
{
B3_PROFILE("free textureData");
if (!textures[i].m_isCached)
{
free(textures[i].textureData1);
}
}

return graphicsIndex;
}

Expand Down

0 comments on commit 306245d

Please sign in to comment.