[PyKDE] BUG - disconnect

Kaleb Pederson kibab at icehouse.net
Mon Nov 4 23:32:01 GMT 2002


> Thanks.  Although it isn't usually necessary, it will be nice to have. 
> There is a bug in PyQt with respect to connections being removed when the
> associated object has been deleted. But I'll try to post some example code
> within the week.
>
> Basically, if I create a parentless object and connect signals to it.  Upon
> deletion of the object, any signals that would thereafter have gone to it
> result in a sip runtime error saying the C++ object has been deleted.

Okay, I modified my previous example to show what is happening.  I highly 
doubt this is my fault, but if it is, I'm sure you'll correct me ;)

I ran it through gdb to see where it was dieing... the last few items in the 
backtrace gave me the following:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 12956)]
0x4141e740 in lazyMethods_QObject () from 
/usr/lib/python2.2/site-packages/libqtcmodule.so
(gdb) bt
#0  0x4141e740 in lazyMethods_QObject () from 
/usr/lib/python2.2/site-packages/libqtcmodule.so
#1  0x00000202 in ?? ()
#2  0x4001f05c in parsePass2 () from 
/usr/lib/python2.2/site-packages/libsip.so
#3  0x4001e89f in sipParseArgs () from 
/usr/lib/python2.2/site-packages/libsip.so
#4  0x413ace9f in sipDo_QWidget_close () from 
/usr/lib/python2.2/site-packages/libqtcmodule.so
#5  0x080d86fd in PyCFunction_Call ()
#6  0x080b62be in PyObject_Call ()
#7  0x0807f350 in PyEval_CallObjectWithKeywords ()
...

Note. If I comment out line 64 then the program works fine and won't segfault.

To reproduce what I did, leave line 64 in and then launch the program.  Hit 
"Launch" as many times as you like.  Now hit "Fire".  All the "child" 
(although parentless) objects get closed/deleted.  Now hit "Fire" a second 
time.  Boom!

Another way to reproduce it is to create some child objects by hitting launch.  
Now close the child objects so they get deleted appropriately.  Once all 
child objects are closed, hit "Fire".

Well, please let me know what you find.  Even if there is just a work around, 
it would be nice to know.

--Kaleb




More information about the PyQt mailing list