diff options
| author | Michael Vogt <egon@bottom> | 2007-05-02 18:43:13 +0200 |
|---|---|---|
| committer | Michael Vogt <egon@bottom> | 2007-05-02 18:43:13 +0200 |
| commit | 500e805d3fa7faee957e67410f525435224f1e21 (patch) | |
| tree | fad6c63e9aa28d7df2effe7d378923e05cf2db10 /python/progress.cc | |
| parent | a231ca12f5fbb6adb55142973eb4d7a284763ace (diff) | |
| parent | cccfb88edd8dd82348ff89f96a0b26ac815b483c (diff) | |
| download | python-apt-500e805d3fa7faee957e67410f525435224f1e21.tar.gz | |
* merged from python-apt--mvo
Diffstat (limited to 'python/progress.cc')
| -rw-r--r-- | python/progress.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/python/progress.cc b/python/progress.cc index f00058c9..df9c2ec1 100644 --- a/python/progress.cc +++ b/python/progress.cc @@ -18,8 +18,10 @@ bool PyCallbackObj::RunSimpleCallback(const char* method_name, PyObject *arglist, PyObject **res) { - if(callbackInst == 0) + if(callbackInst == 0) { + Py_XDECREF(arglist); return false; + } PyObject *method = PyObject_GetAttrString(callbackInst,(char*) method_name); if(method == NULL) { @@ -49,22 +51,24 @@ bool PyCallbackObj::RunSimpleCallback(const char* method_name, // OpProgress interface -// FIXME: add "string Op, string SubOp" as attribute to the callbackInst void PyOpProgress::Update() { - PyObject *o; o = Py_BuildValue("s", Op.c_str()); PyObject_SetAttrString(callbackInst, "op", o); + Py_XDECREF(o); o = Py_BuildValue("s", SubOp.c_str()); PyObject_SetAttrString(callbackInst, "subOp", o); + Py_XDECREF(o); o = Py_BuildValue("b", MajorChange); PyObject_SetAttrString(callbackInst, "majorChange", o); + Py_XDECREF(o); // Build up the argument list... PyObject *arglist = Py_BuildValue("(f)", Percent); if(CheckChange(0.05)) RunSimpleCallback("update", arglist); + Py_XDECREF(arglist); }; void PyOpProgress::Done() |
