diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-07-12 12:50:18 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-07-12 12:50:18 +0200 |
| commit | ebdbc02bfd5d43246bf837527dd659a435b8bfde (patch) | |
| tree | dc152ae00855ec1348b087788a995c42dd169660 /python/cache.cc | |
| parent | 9150e644afe9fa51d61f31054b3a1990034b0e18 (diff) | |
| download | python-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.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 |
