X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fbase%2Febase.cpp;h=e7708633da3544a0655a475cae8dc0fe03c91b35;hb=00623b736cc9488ee71c388b0da9a8fb9071cca4;hp=62746f4be4ea144618b9ccc1054ea53015e9d103;hpb=8ecfc549ce93bc353d6a64f43a0c25dcd65f860e;p=vuplus_dvbapp diff --git a/lib/base/ebase.cpp b/lib/base/ebase.cpp index 62746f4..e770863 100644 --- a/lib/base/ebase.cpp +++ b/lib/base/ebase.cpp @@ -368,16 +368,19 @@ struct eTimerPy static int eTimerPy_traverse(eTimerPy *self, visitproc visit, void *arg) { - PyObject *obj = self->tm->timeout.get(); - Py_VISIT(obj); + PyObject *obj = self->tm->timeout.get(true); + if (obj) { + Py_VISIT(obj); + } return 0; } static int eTimerPy_clear(eTimerPy *self) { - PyObject *obj = self->tm->timeout.get(); - Py_CLEAR(obj); + PyObject *obj = self->tm->timeout.get(true); + if (obj) + Py_CLEAR(obj); return 0; } @@ -436,8 +439,8 @@ eTimerPy_start(eTimerPy* self, PyObject *args) static PyObject * eTimerPy_start_long(eTimerPy* self, PyObject *args) { - long v=0; - if (!PyArg_ParseTuple(args, "l", &v)) { + int v=0; + if (!PyArg_ParseTuple(args, "i", &v)) { return NULL; } self->tm->startLongTimer(v); @@ -572,16 +575,18 @@ struct eSocketNotifierPy static int eSocketNotifierPy_traverse(eSocketNotifierPy *self, visitproc visit, void *arg) { - PyObject *obj = self->sn->activated.get(); - Py_VISIT(obj); + PyObject *obj = self->sn->activated.get(true); + if (obj) + Py_VISIT(obj); return 0; } static int eSocketNotifierPy_clear(eSocketNotifierPy *self) { - PyObject *obj = self->sn->activated.get(); - Py_CLEAR(obj); + PyObject *obj = self->sn->activated.get(true); + if (obj) + Py_CLEAR(obj); return 0; } @@ -748,9 +753,7 @@ static PyMethodDef module_methods[] = { void eBaseInit(void) { - PyObject* m; - - m = Py_InitModule3("eBaseImpl", module_methods, + PyObject* m = Py_InitModule3("eBaseImpl", module_methods, "Module that implements some enigma classes with working cyclic garbage collection."); if (m == NULL)