[PyQt] Updated PyQt Release Plans

Aaron Digulla digulla at hepe.com
Wed Apr 30 21:18:59 BST 2008

Phil Thompson schrieb:

>> - For everything derived from QObject, connect to the dispose signal.
>> At this time, save a stack trace and a pointer to the Python handle
>> associated with the QObject
>> - When the signal is emitted, make sure that the usage count of the
>> corresponding Python object is 0, too. If it isn't, print the saved
>> stack trace and a new one saying that the usage count between Python
>> and C++ is out of sync.
>> For the installation, the debug versions of the libraries should go
>> into special directories so I can put them in the PATH (Windows) or
>> the LD_LIBRARY_PATH (Linux) to select them when my code behaves odd.
> I'm not sure what that gives you. I would imagine that a QObject disappearing 
> while there is still a Python wrapper for it is quite common and legitimate. 
> For example, if you keep a reference to a child object and the parent gets 
> destroyed. The problem is only when you try and use that reference - but if 
> you do then you will get an exception anyway.

I get a core dump and on Windows, I get nothing. Even if I could get a
core file, it wouldn't tell me where the object was created.

So maybe the trick would be to declare the Python object as "invalid" as
soon as the dispose signal was received. After that, any call to any
method should raise an exception.


Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."
http://darkviews.blogspot.com/          http://www.pdark.de/

More information about the PyQt mailing list