X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fbase%2Febase.cpp;h=bcfab61c0fb42a0eb51344e710a0131650de3f18;hb=ec5a129c62b75f939830c0585780bdedf7c78460;hp=6121981194df5b4c9c8258791f3ddfeb1afebf46;hpb=be9f9b15125b46136fefc5051f5661dc15d59ab7;p=vuplus_dvbapp diff --git a/lib/base/ebase.cpp b/lib/base/ebase.cpp index 6121981..bcfab61 100644 --- a/lib/base/ebase.cpp +++ b/lib/base/ebase.cpp @@ -6,6 +6,7 @@ #include #include +#include eSocketNotifier::eSocketNotifier(eMainloop *context, int fd, int requested, bool startnow): context(*context), fd(fd), state(0), requested(requested) { @@ -201,9 +202,14 @@ int eMainloop::processOneEvent(unsigned int twisted_timeout, PyObject **res, ePy if (this == eApp) { + gOpcode op; + op.dc = 0; + op.opcode = gOpcode::flush; + gRC::getInstance()->submit(op); Py_BEGIN_ALLOW_THREADS ret = ::poll(pfd, fdcount, poll_timeout); Py_END_ALLOW_THREADS + } else ret = ::poll(pfd, fdcount, poll_timeout); @@ -362,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; } @@ -566,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; }