diff options
Diffstat (limited to 'python/cache.cc')
| -rw-r--r-- | python/cache.cc | 4 |
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 |
