summaryrefslogtreecommitdiff
path: root/python/progress.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-01-24 18:32:05 +0100
committerJulian Andres Klode <jak@debian.org>2010-01-24 18:32:05 +0100
commit7bf6a8d52ca8e6c7686eeac50ae714dc6a7e4730 (patch)
tree9d49e8b2b250a717018d1eebd74eb66601a4059e /python/progress.h
parente50d26301902821870d4e53ceab42464d7ee91f4 (diff)
downloadpython-apt-7bf6a8d52ca8e6c7686eeac50ae714dc6a7e4730.tar.gz
python/progress.h: PyFetchProgress keeps a reference to pyAcquire.
Diffstat (limited to 'python/progress.h')
-rw-r--r--python/progress.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/progress.h b/python/progress.h
index 80cb2785..7e75652b 100644
--- a/python/progress.h
+++ b/python/progress.h
@@ -74,6 +74,8 @@ struct PyFetchProgress : public pkgAcquireStatus, public PyCallbackObj
virtual bool MediaChange(string Media, string Drive);
void setPyAcquire(PyObject *o) {
+ Py_CLEAR(pyAcquire);
+ Py_INCREF(o);
pyAcquire = o;
}
@@ -86,7 +88,8 @@ struct PyFetchProgress : public pkgAcquireStatus, public PyCallbackObj
virtual void Stop();
bool Pulse(pkgAcquire * Owner);
- PyFetchProgress() : PyCallbackObj() {};
+ PyFetchProgress() : PyCallbackObj(), pyAcquire(0) {};
+ ~PyFetchProgress() { Py_XDECREF(pyAcquire); };
};
struct PyInstallProgress : public PyCallbackObj