Hello again.

Here's the setup

#python
from hybrid import ObjectManager

om = ObjectManager()
om.PassModel()


//cpp
class Model
{
    ~Model()
    {
        printf("model go boom");
    }
    /* */
};

class ObjectManager
{
    Model* PassModel()
    {
        return new Model();
    };
};


When I use code which parallels this structure, I see the Model destructor is called when the c++ object goes out of scope (fine) despite the object being passed to python as the argument of a function (not fine!)

Is there a return policy I need to provide? I am confused by the way the destructing class is new'ed in c++ code, not in python by using exposed c++.

Better luck this time :)

Simon





_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to