Boost logo

Boost Users :

Subject: [Boost-users] [python] Ownership of python objects.
From: Germán Diago (germandiago_at_[hidden])
Date: 2009-09-23 06:54:13


Hello. I'm trying to do the following thing:

1.- Create an object
2.- Put it in an scene (for a game)
3.- To be able to delete it from the scene (this is done from C++)

My problem is that if I do the following:

p = Object("blabla")
Scene.addToScene("myobject", p)

//Here, the object is deleted by C++, which is causing problems
p.removeFromScene("myobject")

I know a workaround for this. It would be to make a wrapper for
objects created from python
and not deleting the object if it was created from there.

But I would like if there is some other (more general) way to avoid
this. Thanks in advance.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net