summaryrefslogtreecommitdiff
path: root/python/cache.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-07-12 12:50:18 +0200
committerJulian Andres Klode <jak@debian.org>2009-07-12 12:50:18 +0200
commitebdbc02bfd5d43246bf837527dd659a435b8bfde (patch)
treedc152ae00855ec1348b087788a995c42dd169660 /python/cache.cc
parent9150e644afe9fa51d61f31054b3a1990034b0e18 (diff)
downloadpython-apt-ebdbc02bfd5d43246bf837527dd659a435b8bfde.tar.gz
python/cache.cc: Set NoDelete for Caches, instead of using the wrong dealloc function.
Diffstat (limited to 'python/cache.cc')
-rw-r--r--python/cache.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/cache.cc b/python/cache.cc
index a9c1a557..40d7b18a 100644
--- a/python/cache.cc
+++ b/python/cache.cc
@@ -285,6 +285,8 @@ static PyObject *PkgCacheNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)
CppOwnedPyObject_NEW<pkgCache *>(CacheFileObj,type,
(pkgCache *)(*Cache));
+ // Do not delete the pointer to the pkgCache, it is managed by pkgCacheFile.
+ CacheObj->NoDelete = true;
Py_DECREF(CacheFileObj);
return CacheObj;
}
@@ -304,7 +306,7 @@ PyTypeObject PkgCacheType =
sizeof(CppOwnedPyObject<pkgCache *>), // tp_basicsize
0, // tp_itemsize
// Methods
- CppOwnedDealloc<pkgCache *>, // tp_dealloc
+ CppOwnedDeallocPtr<pkgCache *>, // tp_dealloc
0, // tp_print
0, // tp_getattr
0, // tp_setattr