[pygccxml-development] Memory ownership
Brought to you by:
mbaas,
roman_yakovenko
From: Philip A. <phi...@my...> - 2006-11-17 12:17:56
|
Hello I'm pretty new to Py++ and Boost::Python. Consider the following code (taken from the unit tests of my wrapped library): self.logManager.addListener(MockLogListener()) The C++ prototype of the addListener method is: void addListener(ILogListener* pListener); I didn't found a way to specify that the logManager instance is now responsible of the destruction of the listener object. Several classes acts this way in my library. The result is that the logManager now holds an invalid pointer, and will throw a C++ exception when trying to use it. Is there any workaround (besides keeping a reference to every object on the Python-side)? |