aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNathan Smith <nathanjsmith@gmail.com>2012-07-03 17:55:04 -0500
committerMarcelo Lira <marcelo.lira@openbossa.org>2012-07-04 20:25:37 +0200
commita3cecbab9735d40f97c0a031dd17ac594cf39e82 (patch)
tree5bec47690f2d692dc0f48670169be0c46b36602d /tests
parente1a91dd721c17727bea41b591336d1cacca6dea4 (diff)
PYSIDE-83 Fix segfault calling shiboken.dump
shiboken.dump would segfault when called on an object whose C++ object had been deleted or whose parent C++ object had been deleted. This now checks to see if the data pointers beneath the PyObject are NULL before printing data. Change-Id: I89763a3ca3a5d25fad4142ff924692cd232c9c40 Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/shibokenmodule/module_test.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/shibokenmodule/module_test.py b/tests/shibokenmodule/module_test.py
index 61a5f568e..54c47de14 100644
--- a/tests/shibokenmodule/module_test.py
+++ b/tests/shibokenmodule/module_test.py
@@ -56,6 +56,12 @@ class TestShiboken(unittest.TestCase):
shiboken.dump(m)
self.assertEqual(len(shiboken.getCppPointer(m)), 2)
+ # Don't crash even after deleting an object
+ shiboken.invalidate(obj)
+ shiboken.dump(obj) # deleted
+ shiboken.dump(p) # child deleted
+ shiboken.dump(obj2) # parent deleted
+
def testDelete(self):
obj = ObjectType()
child = ObjectType(obj)