diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-12-07 13:42:38 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-12-07 13:42:38 +0100 |
| commit | d3897306b07fab8490b32e8822685b54959be3e5 (patch) | |
| tree | 7c36a902fe7336099e43c8c8fe6e9abd09eabeac /python/generic.h | |
| parent | f93c69c24378aaed08c401b4303b60a6c2eb8260 (diff) | |
| download | python-apt-d3897306b07fab8490b32e8822685b54959be3e5.tar.gz | |
* python/generic.h:
- set Object to NULL in CppDeallocPtr
* python/depcache.cc:
- don't run "actiongroup.release()" if the object was already
deallocated
Diffstat (limited to 'python/generic.h')
| -rw-r--r-- | python/generic.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python/generic.h b/python/generic.h index 31c1bc2d..7abf7e7a 100644 --- a/python/generic.h +++ b/python/generic.h @@ -202,8 +202,10 @@ void CppDeallocPtr(PyObject *iObj) std::cerr << "=== DEALLOCATING " << iObj->ob_type->tp_name << "*+ ===\n"; #endif CppPyObject<T> *Obj = (CppPyObject<T> *)iObj; - if (!((CppPyObject<T>*)Obj)->NoDelete) + if (!((CppPyObject<T>*)Obj)->NoDelete) { delete Obj->Object; + Obj->Object = NULL; + } CppClear<T>(iObj); iObj->ob_type->tp_free(iObj); } |
