[Python-modules-commits] r24403 - in packages/shiboken/trunk/debian/patches (2 files)
odyx at users.alioth.debian.org
odyx at users.alioth.debian.org
Thu May 16 15:08:57 UTC 2013
Date: Thursday, May 16, 2013 @ 15:08:55
Author: odyx
Revision: 24403
Add memleak-instead-crash.patch to avoid crash on dereferencing object in tests introduce an intentional memleak until we have a proper fix
LP: #1070772
Added:
packages/shiboken/trunk/debian/patches/memleak-instead-crash.patch
Modified:
packages/shiboken/trunk/debian/patches/series
Added: packages/shiboken/trunk/debian/patches/memleak-instead-crash.patch
===================================================================
--- packages/shiboken/trunk/debian/patches/memleak-instead-crash.patch (rev 0)
+++ packages/shiboken/trunk/debian/patches/memleak-instead-crash.patch 2013-05-16 15:08:55 UTC (rev 24403)
@@ -0,0 +1,64 @@
+Description: exchange crash with a memleak
+ the code in question looks horrible, it dereferences an object and keeps
+ using it, but thats not even the cause of the crash.
+ Intentionally add memleak which is better than crashing in all python
+ versions for now.
+Bug: https://bugreports.qt-project.org/browse/PYSIDE-121
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/shiboken/+bug/1070772
+Author: Julian Taylor <jtaylor at ubuntu.com>
+Last-Update: <2013-02-23>
+
+--- shiboken-1.1.2.orig/libshiboken/basewrapper.cpp
++++ shiboken-1.1.2/libshiboken/basewrapper.cpp
+@@ -1095,7 +1095,7 @@ void destroy(SbkObject* self, void* cppD
+ if (!hasParent && self->d->containsCppWrapper && !self->d->hasOwnership) {
+ // Remove extra ref used by c++ object this will case the pyobject destruction
+ // This can cause the object death
+- Py_DECREF((PyObject*)self);
++ //Py_DECREF((PyObject*)self);
+ }
+
+ //Python Object is not destroyed yet
+--- shiboken-1.1.2.orig/tests/samplebinding/objecttype_test.py
++++ shiboken-1.1.2/tests/samplebinding/objecttype_test.py
+@@ -76,7 +76,7 @@ class ObjectTypeTest(unittest.TestCase):
+ o.getCppParent().setObjectName('parent')
+ self.assertEqual(sys.getrefcount(o), 3)
+ o.destroyCppParent()
+- self.assertEqual(sys.getrefcount(o), 2)
++ self.assertEqual(sys.getrefcount(o), 3)
+
+ if __name__ == '__main__':
+ unittest.main()
+--- shiboken-1.1.2.orig/tests/samplebinding/ownership_delete_parent_test.py
++++ shiboken-1.1.2/tests/samplebinding/ownership_delete_parent_test.py
+@@ -45,7 +45,7 @@ class DeleteParentTest(unittest.TestCase
+
+ del parent
+ self.assertRaises(RuntimeError, child.objectName)
+- self.assertEqual(sys.getrefcount(child), refcount_before-1)
++ self.assertEqual(sys.getrefcount(child), refcount_before)
+
+ def testParentDestructorMultipleChildren(self):
+ '''Delete parent object should invalidate all children'''
+@@ -58,7 +58,7 @@ class DeleteParentTest(unittest.TestCase
+ del parent
+ for i, child in enumerate(children):
+ self.assertRaises(RuntimeError, child.objectName)
+- self.assertEqual(sys.getrefcount(child), 4)
++ self.assertEqual(sys.getrefcount(child), 5)
+
+ def testRecursiveParentDelete(self):
+ '''Delete parent should invalidate grandchildren'''
+@@ -68,9 +68,9 @@ class DeleteParentTest(unittest.TestCase
+
+ del parent
+ self.assertRaises(RuntimeError, child.objectName)
+- self.assertEqual(sys.getrefcount(child), 2)
++ self.assertEqual(sys.getrefcount(child), 3)
+ self.assertRaises(RuntimeError, grandchild.objectName)
+- self.assertEqual(sys.getrefcount(grandchild), 2)
++ self.assertEqual(sys.getrefcount(grandchild), 3)
+
+
+ if __name__ == '__main__':
Modified: packages/shiboken/trunk/debian/patches/series
===================================================================
--- packages/shiboken/trunk/debian/patches/series 2013-05-16 15:08:42 UTC (rev 24402)
+++ packages/shiboken/trunk/debian/patches/series 2013-05-16 15:08:55 UTC (rev 24403)
@@ -1,3 +1,4 @@
cmake_selectDefaultPython.patch
pythonversionindep.patch
python3.3-and-multiarch.patch
+memleak-instead-crash.patch
More information about the Python-modules-commits
mailing list