diff options
| author | Julian Andres Klode <jak@debian.org> | 2010-01-24 18:32:05 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2010-01-24 18:32:05 +0100 |
| commit | 7bf6a8d52ca8e6c7686eeac50ae714dc6a7e4730 (patch) | |
| tree | 9d49e8b2b250a717018d1eebd74eb66601a4059e /python/progress.h | |
| parent | e50d26301902821870d4e53ceab42464d7ee91f4 (diff) | |
| download | python-apt-7bf6a8d52ca8e6c7686eeac50ae714dc6a7e4730.tar.gz | |
python/progress.h: PyFetchProgress keeps a reference to pyAcquire.
Diffstat (limited to 'python/progress.h')
| -rw-r--r-- | python/progress.h | 5 |
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 |
