From 1920130fc973f61b0e42f468df9576a917bf2b2e Mon Sep 17 00:00:00 2001 From: Renato Filho Date: Thu, 29 Jul 2010 19:20:50 -0300 Subject: Fixed cyclic dependency on duck punching test. Reviewer: Marcelo Lira Luciano Wolf --- tests/QtCore/duck_punching_test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/QtCore/duck_punching_test.py b/tests/QtCore/duck_punching_test.py index e20c0c1b1..880a8e435 100644 --- a/tests/QtCore/duck_punching_test.py +++ b/tests/QtCore/duck_punching_test.py @@ -37,6 +37,12 @@ class TestDuckPunchingOnQObjectInstance(UsesQCoreApplication): child = QObject() child.setParent(parent) self.assert_(self.duck_childEvent_called) + # This is done to decrease the refcount of the vm object + # allowing the object wrapper to be deleted before the + # BindingManager. This is useful when compiling Shiboken + # for debug, since the BindingManager destructor has an + # assert that checks if the wrapper mapper is empty. + parent.childEvent = None def testChildEventMonkeyPatchWithInheritance(self): #Test if the new childEvent injected on a QObject's extension class instance is called from C++ @@ -50,6 +56,12 @@ class TestDuckPunchingOnQObjectInstance(UsesQCoreApplication): child = QObject() child.setParent(parent) self.assert_(self.duck_childEvent_called) + # This is done to decrease the refcount of the vm object + # allowing the object wrapper to be deleted before the + # BindingManager. This is useful when compiling Shiboken + # for debug, since the BindingManager destructor has an + # assert that checks if the wrapper mapper is empty. + parent.childEvent = None if __name__ == '__main__': unittest.main() -- cgit v1.2.3