diff options
| author | Michael Vogt <egon@bottom> | 2006-12-19 11:50:52 +0100 |
|---|---|---|
| committer | Michael Vogt <egon@bottom> | 2006-12-19 11:50:52 +0100 |
| commit | 75da7640381be141209986156eba32825019add8 (patch) | |
| tree | 5aa439eeeb55331ca9e8d3245b0c387d8c58ca10 /python/progress.cc | |
| parent | a38c71a5197429ccb1703d9b3c2d943be6017f7d (diff) | |
| parent | 3c393390f10b5ecfb3891fb89f199e2610d9246e (diff) | |
| download | python-apt-75da7640381be141209986156eba32825019add8.tar.gz | |
* merged from mainline
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() |
