From: Matthias B. <ba...@ir...> - 2006-08-15 13:01:40
|
Chris Bainbridge wrote: > In one of my pyode progs I get an invalid memory read reported when > running under valgrind. It seems that dJointGroupDestroy is called by > pyode and destroys all of the joints in the joint group. However, if > there is another reference to the joint, then it will also call > dJointDestroy, causing a read of the already-free'd memory. From ode > src: > > void dJointDestroy (dxJoint *j) > { > dAASSERT (j); > if (j->flags & dJOINT_INGROUP) return; > removeJointReferencesFromAttachedBodies (j); > removeObjectFromList (j); > j->world->nj--; > dFree (j,j->vtable->size); > } > > j->flags & dJOINT_INGROUP returns true because the joint was in a > (already destroyed) joint group, but the read of j->flags is invalid > since the memory was already free'd. Could it be that you had a JointGroup object that you didn't empty explicitly (by calling the empty() method)? In this case, the destructor of the JointGroup object only calls dJointGroupDestroy() without notifying the contained Python joints about the destruction of the ODE joints. I have just committed a fix for this. Let me know if this has also fixed your problem. - Matthias - |