diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-01-13 16:28:45 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-01-13 16:28:45 +0000 |
| commit | d91f2da4c8737499c4f4b97508d12515e50994ce (patch) | |
| tree | ed8761d900c27013a858ec83113cc3c672d544d9 /lib/base/ebase.cpp | |
| parent | 9334ec607d65a4a140337c26099790a20b8084f3 (diff) | |
| download | enigma2-d91f2da4c8737499c4f4b97508d12515e50994ce.tar.gz enigma2-d91f2da4c8737499c4f4b97508d12515e50994ce.zip | |
fix memleak,
speedups
Diffstat (limited to 'lib/base/ebase.cpp')
| -rw-r--r-- | lib/base/ebase.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/base/ebase.cpp b/lib/base/ebase.cpp index 1b92995b..00ecb345 100644 --- a/lib/base/ebase.cpp +++ b/lib/base/ebase.cpp @@ -200,16 +200,16 @@ int eMainloop::processOneEvent(unsigned int user_timeout, PyObject **res, PyObje { for (int i=0; i < PyList_Size(additional); ++i) { - PyObject *it = PyList_GetItem(additional, i); + PyObject *it = PyList_GET_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"); - int fd = PyObject_AsFileDescriptor(PyTuple_GetItem(it, 0)); + int fd = PyObject_AsFileDescriptor(PyTuple_GET_ITEM(it, 0)); if (fd == -1) eFatal("poll tuple not a filedescriptor"); pfd[nativecount + i].fd = fd; - pfd[nativecount + i].events = PyInt_AsLong(PyTuple_GetItem(it, 1)); + pfd[nativecount + i].events = PyInt_AsLong(PyTuple_GET_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); - PyTuple_SetItem(it, 0, PyInt_FromLong(pfd[i].fd)); - PyTuple_SetItem(it, 1, PyInt_FromLong(pfd[i].revents)); + PyTuple_SET_ITEM(it, 0, PyInt_FromLong(pfd[i].fd)); + PyTuple_SET_ITEM(it, 1, PyInt_FromLong(pfd[i].revents)); PyList_Append(*res, it); + Py_DECREF(it); } } |
