use PyObject_Callback instead of PyEval_Callback (memleak fix?)
[enigma2.git] / lib / dvb / epgcache.cpp
index 88fd677a4ed4aef644897eaca0e8eee6ec3e95cc..60eee05a2369627b272a6e2d13900f8f264405f1 100644 (file)
@@ -1264,21 +1264,26 @@ PyObject *handleEvent(ePtr<eServiceEvent> &ptr, PyObject *dest_list, char* argst
        if (convertFunc)
        {
                fillTuple(convertFuncArgs, argstring, argcount, service, ptr, nowTime, service_name);
-               PyObject *result = PyEval_CallObject(convertFunc, convertFuncArgs);
+               PyObject *result = PyObject_CallObject(convertFunc, convertFuncArgs);
                if (result == NULL)
                {
+                       if (service_name)
+                               Py_DECREF(service_name);
                        if (nowTime)
                                Py_DECREF(nowTime);
                        Py_DECREF(convertFuncArgs);
+                       Py_DECREF(dest_list);
                        return result;
                }
                PyList_Append(dest_list, result);
+               Py_DECREF(result);
        }
        else
        {
                PyObject *tuple = PyTuple_New(argcount);
                fillTuple(tuple, argstring, argcount, service, ptr, nowTime, service_name);
                PyList_Append(dest_list, tuple);
+               Py_DECREF(tuple);
        }
        return 0;
 }