[C++-sig] ownership of C++ object extended in Python

Mark Williams mark at image-engine.com
Thu Mar 22 21:49:58 CET 2007


> I am also looking for solution. I think I have something, but I am not sure.
> I think if you create small and complete test case, submit it may be more
> knowledgeable developers will be able to help you.
> If I will make some progress I will let you know
> 

Thanks again for your help. I've produced what I believe to be a fairly 
minimal test case, attached. When run it produces the output:

Calling test funcion...
Entering test()...
Making PythonDerived object...
Holding...
Retrieving held PythonDerived object...
Calling member function of held PythonDerived object...
** my string data **
PythonDerived object goes out of Python scope here...
Leaving test()...
PythonDerived.__del__

Retrieving held PythonDerived object...
Calling member function of held PythonDerived object...
** my string data **
PythonDerived.__del__
Segmentation fault




Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CppBase.cpp
Type: text/x-c++src
Size: 1814 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20070322/6d3e87e0/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PythonDerived.py
Type: application/x-python
Size: 897 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20070322/6d3e87e0/attachment.bin>


More information about the Cplusplus-sig mailing list