From: Andrew D. <ad...@gm...> - 2005-10-05 05:48:01
|
On 10/4/05, Matthias Baas <ba...@ir...> wrote: > > I couldn't run your code as I don't have PyOgre but it seems the problem > is you store the BallJoint in a local variable which gets deleted at the > end of the method. And as j1 is the only reference to the BallJoint > object the BallJoint is garbage collected when j1 is deleted which will > also delete the underlying ODE BallJoint. To fix this you simply have to > keep a Python reference to the joint (self.j1 =3D ode.BallJoint(...)). Yes, that fixes it -- although it seems a little unnatural. I would have expected that the world would maintain the object, and that PyODE would not delete the joint merely because the Python reference gets collected... Anyway, thanks! I've got a solution now. |