summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-07-12 12:48:22 +0200
committerJulian Andres Klode <jak@debian.org>2009-07-12 12:48:22 +0200
commit9150e644afe9fa51d61f31054b3a1990034b0e18 (patch)
tree872fc7b1c8f78b5633ead82e96af8a7a72187533 /python
parent5867a0fb2a56ebe6b42dd794ac70a51036f9159f (diff)
downloadpython-apt-9150e644afe9fa51d61f31054b3a1990034b0e18.tar.gz
python/depcache.cc: Set NoDelete for DepCaches, instead of using the wrong dealloc function.
Diffstat (limited to 'python')
-rw-r--r--python/depcache.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/python/depcache.cc b/python/depcache.cc
index 17e2bc30..68ca3a3b 100644
--- a/python/depcache.cc
+++ b/python/depcache.cc
@@ -670,9 +670,11 @@ static PyObject *PkgDepCacheNew(PyTypeObject *type,PyObject *Args,PyObject *kwds
CppOwnedPyObject<pkgDepCache*> *DepCachePyObj;
DepCachePyObj = CppOwnedPyObject_NEW<pkgDepCache*>(Owner,type,depcache);
- HandleErrors(DepCachePyObj);
- return DepCachePyObj;
+ // Do not delete the underlying pointer, it is managed by the cachefile.
+ DepCachePyObj->NoDelete = true;
+
+ return HandleErrors(DepCachePyObj);
}
static char *doc_PkgDepCache = "DepCache(cache) -> DepCache() object\n\n"
@@ -685,8 +687,7 @@ PyTypeObject PkgDepCacheType =
sizeof(CppOwnedPyObject<pkgDepCache *>), // tp_basicsize
0, // tp_itemsize
// Methods
- // Not ..Ptr, because the pkgDepCache pointer is managed by the CacheFile.
- CppOwnedDealloc<pkgDepCache *>, // tp_dealloc
+ CppOwnedDeallocPtr<pkgDepCache *>, // tp_dealloc
0, // tp_print
0, // tp_getattr
0, // tp_setattr