summaryrefslogtreecommitdiff
path: root/python/generic.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-12-12 14:26:26 +0100
committerJulian Andres Klode <jak@debian.org>2010-12-12 14:26:26 +0100
commit88cbcaa5a0fcffd319004b85287f0de42f622571 (patch)
tree05db30be0c16f1b58c3ff8f1e4b2dd8a5d3c3eb7 /python/generic.h
parenteca74f2d3cdfc32ac9c8daeb50bba70da8590d91 (diff)
parent6a05a8302c405c4c8d1b59f6be8c2d0974c6ce1e (diff)
downloadpython-apt-88cbcaa5a0fcffd319004b85287f0de42f622571.tar.gz
Merge from mvo
* python/generic.h: - set Object to NULL in CppDeallocPtr * python/depcache.cc: - don't run "actiongroup.release()" if the object was already deallocated * tests/test_apt_cache.py: - fix tests to work if apt compressed indexes are enabled
Diffstat (limited to 'python/generic.h')
-rw-r--r--python/generic.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/generic.h b/python/generic.h
index fc2a6c06..ce9e5091 100644
--- a/python/generic.h
+++ b/python/generic.h
@@ -204,8 +204,10 @@ void CppDeallocPtr(PyObject *iObj)
std::cerr << "=== DEALLOCATING " << iObj->ob_type->tp_name << "*+ ===\n";
#endif
CppPyObject<T> *Obj = (CppPyObject<T> *)iObj;
- if (!((CppPyObject<T>*)Obj)->NoDelete)
+ if (!((CppPyObject<T>*)Obj)->NoDelete) {
delete Obj->Object;
+ Obj->Object = NULL;
+ }
CppClear<T>(iObj);
iObj->ob_type->tp_free(iObj);
}