summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-12-22 10:50:50 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2010-12-22 10:50:50 +0100
commit33dd13058d468772153e3182c7d8b126f1e0f6ba (patch)
tree209d17b3eec3dc220e664dd59964764e684444aa /python
parentb4816b79b3ce90fdabed8e812fc8e6f7109d1de0 (diff)
downloadpython-apt-33dd13058d468772153e3182c7d8b126f1e0f6ba.tar.gz
* python/depcache.cc:
- when using the actiongroup as a contextmanager incref/decref on enter and leave. this should fix the instablity issues that aptdaemon runs into (LP: #691134)
Diffstat (limited to 'python')
-rw-r--r--python/depcache.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/depcache.cc b/python/depcache.cc
index 014ad7ae..a84eb615 100644
--- a/python/depcache.cc
+++ b/python/depcache.cc
@@ -989,7 +989,8 @@ static const char *actiongroup__enter__doc =
static PyObject *PkgActionGroupEnter(PyObject *Self,PyObject *Args) {
if (PyArg_ParseTuple(Args,"") == 0)
return 0;
- return Self;
+ Py_INCREF(Self);
+ return Self;
}
static const char *actiongroup__exit__doc =
@@ -999,6 +1000,7 @@ static PyObject *PkgActionGroupExit(PyObject *Self,PyObject *Args) {
pkgDepCache::ActionGroup *ag = GetCpp<pkgDepCache::ActionGroup*>(Self);
if (ag != NULL)
ag->release();
+ Py_DECREF(Self);
Py_RETURN_FALSE;
}