diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-07-14 18:43:50 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-07-14 18:43:50 +0200 |
| commit | 6b9a8176d06bbe0e00b9c0d37b33c7a4e6fe4054 (patch) | |
| tree | 6e9d4d29cdc6ebd252a6706e30619bbcc0a1129f /python/acquire.cc | |
| parent | 0f753709899127e0bbdc6bfcabfc84b0ba5cd3c2 (diff) | |
| download | python-apt-6b9a8176d06bbe0e00b9c0d37b33c7a4e6fe4054.tar.gz | |
python/acquire.cc: Check that an owner exists in AcquireItemDealloc.
Diffstat (limited to 'python/acquire.cc')
| -rw-r--r-- | python/acquire.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/python/acquire.cc b/python/acquire.cc index 8b6de173..9104644d 100644 --- a/python/acquire.cc +++ b/python/acquire.cc @@ -112,6 +112,12 @@ static PyObject *AcquireItemRepr(PyObject *Self) static void AcquireItemDealloc(PyObject *self) { pkgAcquire::Item *file = GetCpp<pkgAcquire::Item*>(self); PyAcquireObject *owner = (PyAcquireObject *)GetOwner<pkgAcquire::Item*>(self); + + // Simply deallocate the object if we have no owner. + if (owner == NULL) { + CppOwnedDeallocPtr<pkgAcquire::Item*>(self); + return; + } vector<PyAcquireItemObject *> &items = owner->items; bool DeletePtr = !((CppPyObject<pkgAcquire::Item*> *)self)->NoDelete; |
