From d7e81590b5cad42079cf588888019aece895f3e6 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Wed, 2 May 2018 12:24:31 -0700 Subject: [PATCH 1/3] fix a memory leak --- examples/SharedMemory/PhysicsServerExample.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/SharedMemory/PhysicsServerExample.cpp b/examples/SharedMemory/PhysicsServerExample.cpp index 0d2908ae5..72b0d0598 100644 --- a/examples/SharedMemory/PhysicsServerExample.cpp +++ b/examples/SharedMemory/PhysicsServerExample.cpp @@ -756,6 +756,12 @@ public: delete m_debugDraw; m_debugDraw = 0; } + + for (int i=0;i Date: Wed, 2 May 2018 12:49:35 -0700 Subject: [PATCH 2/3] fix memory leak --- examples/MultiThreading/b3PosixThreadSupport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/MultiThreading/b3PosixThreadSupport.cpp b/examples/MultiThreading/b3PosixThreadSupport.cpp index 9a00d48aa..269579ab5 100644 --- a/examples/MultiThreading/b3PosixThreadSupport.cpp +++ b/examples/MultiThreading/b3PosixThreadSupport.cpp @@ -277,8 +277,8 @@ void b3PosixThreadSupport::stopThreads() destroySem(spuStatus.startSemaphore); printf("semaphore destroyed\n"); checkPThreadFunction(pthread_join(spuStatus.thread,0)); - - } + delete spuStatus.m_lsMemory; + } printf("destroy main semaphore\n"); destroySem(m_mainSemaphore); printf("main semaphore destroyed\n"); From 790deb2d54b87278fe9c59ab2c94d3de330f8b6f Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Wed, 2 May 2018 13:12:25 -0700 Subject: [PATCH 3/3] fix memory leak in PyBullet.getJointStates, fixes issue #1661 --- examples/pybullet/pybullet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index 31cdc20eb..6e9b42495 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -3551,6 +3551,7 @@ static PyObject* pybullet_getJointStates(PyObject* self, PyObject* args, PyObjec return NULL; } } + Py_DECREF(jointIndicesSeq); return resultListJointState; } }