From: Ethan Glasser-C. <gl...@cs...> - 2010-01-11 03:41:40
|
Daniele Varrazzo wrote: > So, it looks like a structures ownership issue: as the head works, as > soon as the python object goes, so it does the wrapped C geom, also > when it is part of other structures (the space). This is a > counterintuitive behaviour from a Python P.o.V., because "well > behaved" python object are kept alive when another structure points to > them (while instead the association space ->geom seems more a weakref > now). Also the different outcome between my box and yours doesn't seem > a sign of robustness. Oh, crap, this is because you're running tutorial3 from the site, which hasn't been updated in a while. Boy, is my face red. There was a change a while back that made geoms get deallocated, and I updated tutorial3 in CVS but not on the site. I'm looking to see if I can do that now. It's true that the relationship space->geom behaves like a weakref, and so does the relationship world->body. I don't think there's any technical reason for this. It looks like at one point someone wanted to make geoms keep a reference to spaces they were in, but it doesn't look like that functionality got implemented. I think you're probably right, that spaces should keep references to their geoms, but not the other way around. I'll try to make that change this week. Ethan |