Hi Phil,

I've got another bug with object lifetimes:

=========================================
from qt import *
import weakref

app = QApplication([])

ql = QListView(None)
viewport = ql.viewport()

o = QObject(viewport)
o.xxx = viewport  # bug-trigger!

destroyed = []
def cb(wr):
    destroyed.append(1)
wr = weakref.ref(o, cb)

del o
del viewport
assert not destroyed, "object destroyed too early #1!"

import gc
gc.collect()
assert not destroyed, "object destroyed too early #2!"

del ql
import gc
gc.collect()
assert destroyed, "object never destroyed!"
=========================================
Traceback (most recent call last):
  File "pyqtbug19.py", line 25, in ?
    assert not destroyed, "object destroyed too early #2!"
AssertionError: object destroyed too early #2!


This happens with latest PyQt and SIP official releases (3.17.1 and 4.6). The line that seems to trigger the bug is the one marked with a comment.
--
Giovanni Bajo

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to