Merge remote-tracking branch 'origin/bug_453_multiepg_no_more_ask_bouquet'
[vuplus_dvbapp] / lib / python / connections.cpp
index fd3e2a4..c0d38f8 100644 (file)
@@ -2,13 +2,11 @@
 
 PSignal::PSignal()
 {
 
 PSignal::PSignal()
 {
-       m_list = PyList_New(0);
-       Py_INCREF(m_list);
 }
 
 PSignal::~PSignal()
 {
 }
 
 PSignal::~PSignal()
 {
-       Py_DECREF(m_list);
+       Py_XDECREF(m_list);
 }
 
 void PSignal::callPython(ePyObject tuple)
 }
 
 void PSignal::callPython(ePyObject tuple)
@@ -24,6 +22,19 @@ void PSignal::callPython(ePyObject tuple)
 
 PyObject *PSignal::get()
 {
 
 PyObject *PSignal::get()
 {
+       if (!m_list)
+               m_list = PyList_New(0);
        Py_INCREF(m_list);
        return m_list;
 }
        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;
+}