git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix install path
[enigma2.git]
/
lib
/
base
/
ebase.cpp
diff --git
a/lib/base/ebase.cpp
b/lib/base/ebase.cpp
index 1b92995b2e3cb5c1d90d872b74c17f33655de98a..7a57d533acb511a2b7b1c6366b5dfb074590c89f 100644
(file)
--- a/
lib/base/ebase.cpp
+++ b/
lib/base/ebase.cpp
@@
-157,7
+157,7
@@
int eMainloop::processOneEvent(unsigned int user_timeout, PyObject **res, PyObje
poll_timeout /= 1000;
}
poll_timeout /= 1000;
}
- if ((user_timeout > 0) && (poll_timeout > user_timeout))
+ if ((user_timeout > 0) && (poll_timeout >
0) && ((unsigned int)poll_timeout >
user_timeout))
{
poll_timeout = user_timeout;
return_reason = 1;
{
poll_timeout = user_timeout;
return_reason = 1;
@@
-200,16
+200,16
@@
int eMainloop::processOneEvent(unsigned int user_timeout, PyObject **res, PyObje
{
for (int i=0; i < PyList_Size(additional); ++i)
{
{
for (int i=0; i < PyList_Size(additional); ++i)
{
- PyObject *it = PyList_G
etItem
(additional, i);
+ PyObject *it = PyList_G
ET_ITEM
(additional, i);
if (!PyTuple_Check(it))
eFatal("poll item is not a tuple");
if (PyTuple_Size(it) != 2)
eFatal("poll tuple size is not 2");
if (!PyTuple_Check(it))
eFatal("poll item is not a tuple");
if (PyTuple_Size(it) != 2)
eFatal("poll tuple size is not 2");
- int fd = PyObject_AsFileDescriptor(PyTuple_G
etItem
(it, 0));
+ int fd = PyObject_AsFileDescriptor(PyTuple_G
ET_ITEM
(it, 0));
if (fd == -1)
eFatal("poll tuple not a filedescriptor");
pfd[nativecount + i].fd = fd;
if (fd == -1)
eFatal("poll tuple not a filedescriptor");
pfd[nativecount + i].fd = fd;
- pfd[nativecount + i].events = PyInt_AsLong(PyTuple_G
etItem
(it, 1));
+ pfd[nativecount + i].events = PyInt_AsLong(PyTuple_G
ET_ITEM
(it, 1));
}
}
}
}
@@
-254,9
+254,10
@@
int eMainloop::processOneEvent(unsigned int user_timeout, PyObject **res, PyObje
if (!*res)
*res = PyList_New(0);
PyObject *it = PyTuple_New(2);
if (!*res)
*res = PyList_New(0);
PyObject *it = PyTuple_New(2);
- PyTuple_S
etItem
(it, 0, PyInt_FromLong(pfd[i].fd));
- PyTuple_S
etItem
(it, 1, PyInt_FromLong(pfd[i].revents));
+ PyTuple_S
ET_ITEM
(it, 0, PyInt_FromLong(pfd[i].fd));
+ PyTuple_S
ET_ITEM
(it, 1, PyInt_FromLong(pfd[i].revents));
PyList_Append(*res, it);
PyList_Append(*res, it);
+ Py_DECREF(it);
}
}
}
}
@@
-332,6
+333,13
@@
int eMainloop::runLoop()
PyObject *eMainloop::poll(PyObject *timeout, PyObject *dict)
{
PyObject *res = 0;
PyObject *eMainloop::poll(PyObject *timeout, PyObject *dict)
{
PyObject *res = 0;
+
+ if (app_quit_now)
+ {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
int user_timeout = (timeout == Py_None) ? 0 : PyInt_AsLong(timeout);
iterate(user_timeout, &res, dict);
int user_timeout = (timeout == Py_None) ? 0 : PyInt_AsLong(timeout);
iterate(user_timeout, &res, dict);