#include <lib/base/eerror.h>
#include <lib/base/elock.h>
+#include <lib/gdi/grc.h>
eSocketNotifier::eSocketNotifier(eMainloop *context, int fd, int requested, bool startnow): context(*context), fd(fd), state(0), requested(requested)
{
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);
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;
}
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;
}