<br> Thanks Phil for your help with our memory lapse.<br><br> We've come across another issue: the Python garbage collector isn't sussing out circular references properly.<br><br> A previous post by you say that this should be working:<br><br>http://www.riverbankcomputing.com/pipermail/pyqt/2007-May/016237.html<br><br> Here's a simple demonstration:<br><br>>>> from PyQt4.QtCore import QObject<br>>>> class q(QObject):<br>... def init(self):<br>... QObject.init(self)<br>... def __del__(self):<br>... print 'q deleted.'<br>...<br>>>> q1 = q()<br>>>> q1 = None<br>q deleted.<br>>>> q2 = q()<br>>>> q2.circularReference = q2<br>>>> q2 = None<br>>>> q3 = q()<br>>>> q3.circularReference = q3<br>>>> q3.deleteLater()<br>>>> q3 = None<br>>>> import
gc<br>>>> gc.collect()<br>0<br>>>> q4 = q()<br>>>> q4.circularReference = q4<br>>>> q4.circularReference = None<br>>>> q4 = None<br>q deleted.<br><br> q2 and q3 are never gc'ed.<br><br> We're also seeing this in production. Are we doing something wrong? <br><br>Charles.<br><br>see: http://www.google.com/search?source=ig&hl=en&q=pyqt+%22circular+references%22&btnG=Google+Search<br><br><br><b><i>Phil Thompson <phil@riverbankcomputing.co.uk></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> On Monday 30 July 2007 5:16 pm, charles chen wrote:<br>> We're having trouble seeing the QMdiArea's subWindowActivated signal.<br>><br>> Is this related to the "signal/slot handling fix." from 7/16-7/20?<br>> http://www.riverbankcomputing.com/Downloads/Snapshots/PyQt4/ChangeLog<br>><br>>
We're using:<br>> sip-snapshot-20070612.zip<br>> PyQt-win-commercial-4-snapshot-20070612.zip<br>><br>> The relevant code:<br>><br>> self.__workspace__ = QMdiArea()<br>> QObject.connect( self.__workspace__, SIGNAL('subWindowActivated (<br>> QMdiSubWindow * window )'), self.handleSubwindowActivated )<br>><br>> def handleSubwindowActivated(self, ignore=None ):<br>> ...<br>><br>> Here's a link to the Qt docs of the signal:<br>> http://doc.trolltech.com/4.3/qmdiarea.html#subWindowActivated<br><br>Don't pass argument names to SIGNAL().<br><br>Phil<br></blockquote><br>