summaryrefslogtreecommitdiff
path: root/python/depcache.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-12-07 13:42:38 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2010-12-07 13:42:38 +0100
commitd3897306b07fab8490b32e8822685b54959be3e5 (patch)
tree7c36a902fe7336099e43c8c8fe6e9abd09eabeac /python/depcache.cc
parentf93c69c24378aaed08c401b4303b60a6c2eb8260 (diff)
downloadpython-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/depcache.cc')
-rw-r--r--python/depcache.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/depcache.cc b/python/depcache.cc
index b7294644..014ad7ae 100644
--- a/python/depcache.cc
+++ b/python/depcache.cc
@@ -997,7 +997,8 @@ static const char *actiongroup__exit__doc =
"Same as release(), but for use as a context manager.";
static PyObject *PkgActionGroupExit(PyObject *Self,PyObject *Args) {
pkgDepCache::ActionGroup *ag = GetCpp<pkgDepCache::ActionGroup*>(Self);
- ag->release();
+ if (ag != NULL)
+ ag->release();
Py_RETURN_FALSE;
}