[C++-sig] Howto delete python object from C++ code.

Siarhei Rachytski siarhei.rachytski at gmail.com
Mon Jan 8 22:30:59 CET 2007


Hi

I have a python wrapper for a class which implements a Win32 window in
a separate thread. When it's created the message loop is initiated
from a separate thread, and when loop exits(this means the user
pressed the close button and the window should be destroyed), I want
to delete a C++ object and its python counterpart. I delete C++ object
using boost::python::decref, however the python variable this object
has been assigned to still exists, the "print" function shows me smth
like this (cgepython.Window object at 0xADDRHERE). But I want it to be
deleted too. How could I implement this behaviour?

Thanks in advance.

Siarhei Rachytski



More information about the Cplusplus-sig mailing list