PyBullet: fix memory leak in changeTexture command

Fixes #2481
This commit is contained in:
Erwin Coumans 2019-11-14 17:07:08 -08:00
parent cabef63b1c
commit 24a76614f8

View File

@ -1,4 +1,5 @@
//#include "D:/develop/visual_leak_detector/include/vld.h"
//#include "D:/dev/visual leak detector/include/vld.h"
#include "../SharedMemory/PhysicsClientC_API.h"
#include "../SharedMemory/PhysicsDirectC_API.h"
#include "../SharedMemory/SharedMemoryInProcessPhysicsC_API.h"
@ -7259,6 +7260,7 @@ static PyObject* pybullet_changeTexture(PyObject* self, PyObject* args, PyObject
}
}
Py_DECREF(seqPixels);
commandHandle = b3CreateChangeTextureCommandInit(sm, textureUniqueId, width, height, (const char*)pixelBuffer);
free(pixelBuffer);
statusHandle = b3SubmitClientCommandAndWaitStatus(sm, commandHandle);