diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-10-29 19:46:57 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-10-29 19:46:57 +0000 |
| commit | 10e7e45ae92d4fe06f70126ed256b87896dbc432 (patch) | |
| tree | f4b03eb252e5517ccb67be3cd8463c10e14e147c /lib/python/connections.cpp | |
| parent | 6bb94cd5b0d8fd3608afe84e8d76aef554a4b401 (diff) | |
| download | enigma2-10e7e45ae92d4fe06f70126ed256b87896dbc432.tar.gz enigma2-10e7e45ae92d4fe06f70126ed256b87896dbc432.zip | |
better solution to add possibility to delete eSocketNotifiers,
eConsoleAppContainers in callback funktions without crash
Diffstat (limited to 'lib/python/connections.cpp')
| -rw-r--r-- | lib/python/connections.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/python/connections.cpp b/lib/python/connections.cpp index b54c07b1..c0d38f89 100644 --- a/lib/python/connections.cpp +++ b/lib/python/connections.cpp @@ -1,14 +1,11 @@ #include <lib/python/connections.h> PSignal::PSignal() - :m_destroyed(0) { } PSignal::~PSignal() { - if (m_destroyed) - *m_destroyed = true; Py_XDECREF(m_list); } @@ -23,12 +20,21 @@ void PSignal::callPython(ePyObject tuple) } } -PyObject *PSignal::get(bool steal) +PyObject *PSignal::get() { - if (!steal) { - if (!m_list) - m_list = PyList_New(0); - Py_INCREF(m_list); + if (!m_list) + m_list = PyList_New(0); + Py_INCREF(m_list); + return m_list; +} + +PyObject *PSignal::getSteal(bool clear) +{ + if (clear) + { + ePyObject ret = m_list; + m_list = (PyObject*)0; + return ret; } return m_list; } |
