X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/7542f853b1a682ad9bf21b592f26e31e3b64521c..0a860f49e476ccb2d921f6292cd528e490072718:/lib/python/connections.cpp 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 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; }