language_cache.py: small fix
[enigma2.git] / lib / base / nconfig.cpp
index 878f48370cddf017f0728a7d854103269e079709..106558ac1e649f883263a7a783b1ee4ad00e8ec8 100644 (file)
@@ -1,9 +1,9 @@
 #include <lib/base/nconfig.h>
 #include <lib/python/python.h>
 
-PyObject *ePythonConfigQuery::m_queryFunc;
+ePyObject ePythonConfigQuery::m_queryFunc;
 
-void ePythonConfigQuery::setQueryFunc(PyObject *queryFunc)
+void ePythonConfigQuery::setQueryFunc(ePyObject queryFunc)
 {
        if (m_queryFunc)
                Py_DECREF(m_queryFunc);
@@ -16,15 +16,16 @@ RESULT ePythonConfigQuery::getConfigValue(const char *key, std::string &value)
 {
        if (key && PyCallable_Check(m_queryFunc))
        {
-               PyObject *pArgs = PyTuple_New(1);
+               ePyObject pArgs = PyTuple_New(1);
                PyTuple_SET_ITEM(pArgs, 0, PyString_FromString(key));
-               PyObject *pRet = PyObject_CallObject(m_queryFunc, pArgs);
+               ePyObject pRet = PyObject_CallObject(m_queryFunc, pArgs);
                Py_DECREF(pArgs);
                if (pRet)
                {
                        if (PyString_Check(pRet))
                        {
                                value.assign(PyString_AS_STRING(pRet));
+                               Py_DECREF(pRet);
                                return 0;
                        }
                        Py_DECREF(pRet);