summaryrefslogtreecommitdiff
path: root/python/cache.cc
diff options
context:
space:
mode:
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 22ed9ecc..80a7a8a5 100644
--- a/python/cache.cc
+++ b/python/cache.cc
@@ -247,7 +247,9 @@ void PkgCacheFileDealloc(PyObject *Self)
PyObject *CacheFilePy = GetOwner<pkgCache*>(Self);
pkgCacheFile *CacheF = GetCpp<pkgCacheFile*>(CacheFilePy);
CacheF->Close();
- CppOwnedDeallocPtr<pkgCache *>(Self);
+ // Do not delete the pointer here, because it has already been deleted by
+ // closing the cache file.
+ CppOwnedDealloc<pkgCache *>(Self);
}
static PyObject *PkgCacheNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)