Fixed memory leak on callbacks used on signal connection.

Now using the 'destroyed()' signal the reference is cleaned after source
object destroyed.
This commit is contained in:
Renato Filho 2010-02-19 17:10:24 -03:00
commit 75b7afbd63
11 changed files with 212 additions and 84 deletions

View file

@ -50,6 +50,18 @@ class PythonSigSlot(unittest.TestCase):
self.assert_(self.called)
def testDisconnect(self):
obj1 = Dummy()
QObject.connect(obj1, SIGNAL('foo(int)'), self.callback)
QObject.disconnect(obj1, SIGNAL('foo(int)'), self.callback)
self.args = (42, )
obj1.emit(SIGNAL('foo(int)'), *self.args)
self.assert_(not self.called)
@requires('PySide.QtGui')
class SpinBoxPySignal(UsesQApplication):
"""Tests the connection of python signals to QSpinBox qt slots."""