mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-13 21:30:09 +00:00
fix memory leak in calculateInverseKinematics2, reported here:
https://github.com/bulletphysics/bullet3/issues/3228 Thanks jcoholich for the report and repro case!
This commit is contained in:
parent
375d7097e4
commit
10020baa71
@ -1,4 +1,4 @@
|
||||
//#include "D:/dev/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"
|
||||
@ -11642,6 +11642,8 @@ static PyObject* pybullet_calculateInverseKinematics2(PyObject* self,
|
||||
free(upperLimits);
|
||||
free(jointRanges);
|
||||
free(restPoses);
|
||||
free(positions);
|
||||
free(indices);
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
@ -11762,12 +11764,16 @@ static PyObject* pybullet_calculateInverseKinematics2(PyObject* self,
|
||||
}
|
||||
|
||||
free(ikOutPutJointPos);
|
||||
free(positions);
|
||||
free(indices);
|
||||
return pylist;
|
||||
}
|
||||
else
|
||||
{
|
||||
PyErr_SetString(SpamError,
|
||||
"Error in calculateInverseKinematics");
|
||||
free(positions);
|
||||
free(indices);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@ -11775,8 +11781,13 @@ static PyObject* pybullet_calculateInverseKinematics2(PyObject* self,
|
||||
{
|
||||
PyErr_SetString(SpamError,
|
||||
"calculateInverseKinematics couldn't extract position vector3");
|
||||
free(positions);
|
||||
free(indices);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
free(positions);
|
||||
free(indices);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user