summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerwincoumans <erwincoumans@google.com>2020-08-13 16:42:27 -0700
committerGitHub <noreply@github.com>2020-08-13 16:42:27 -0700
commit5140815cdd4d708bf071206b5d8f5754c656c344 (patch)
tree47e3b48e0cc2ddf223a8161227d8fd0b87e58a3a
parent1c818fda32693ac4ada234de3965f7e369e49fc9 (diff)
parent8504384b63afbb3d4a505d6159af340e0575cf4b (diff)
downloadbullet3-5140815cdd4d708bf071206b5d8f5754c656c344.tar.gz
Merge pull request #2987 from erwincoumans/master
fix potential memory leak in createMultiBody
-rw-r--r--examples/SharedMemory/PhysicsServerCommandProcessor.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp
index b9a890d57..3fb7052ae 100644
--- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp
+++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp
@@ -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;
}