aboutsummaryrefslogtreecommitdiffstats
path: root/tests/signals/pysignal_test.py
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-02-19 17:10:24 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-02-23 16:35:40 -0300
commit75b7afbd63be9b27d3bd964891720e8c16079280 (patch)
treef56e9d83a73bff0119333649521663f5c45aad20 /tests/signals/pysignal_test.py
parentab738e07d2cffc0fc9692ecc3a5f830847b853bb (diff)
Fixed memory leak on callbacks used on signal connection.
Now using the 'destroyed()' signal the reference is cleaned after source object destroyed.
Diffstat (limited to 'tests/signals/pysignal_test.py')
-rw-r--r--tests/signals/pysignal_test.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/signals/pysignal_test.py b/tests/signals/pysignal_test.py
index 3d741dcca..639a7dee2 100644
--- a/tests/signals/pysignal_test.py
+++ b/tests/signals/pysignal_test.py
@@ -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."""