X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/7542f853b1a682ad9bf21b592f26e31e3b64521c..fe4e69236a090ad6c0e125814313f275d2716b53:/lib/python/connections.h diff --git a/lib/python/connections.h b/lib/python/connections.h index ab123137..b4cd1c79 100644 --- a/lib/python/connections.h +++ b/lib/python/connections.h @@ -3,23 +3,20 @@ #include - /* avoid warnigs :) */ -#include -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200112L - #include class PSignal { protected: ePyObject m_list; - bool *m_destroyed; public: PSignal(); ~PSignal(); void callPython(SWIG_PYOBJECT(ePyObject) tuple); - PyObject *get(bool steal=false); +#ifndef SWIG + PyObject *getSteal(bool clear=false); +#endif + PyObject *get(); }; inline PyObject *PyFrom(int v) @@ -38,18 +35,13 @@ class PSignal0: public PSignal, public Signal0 public: R operator()() { - bool destroyed=false; - m_destroyed = &destroyed; if (m_list) { PyObject *pArgs = PyTuple_New(0); callPython(pArgs); Org_Py_DECREF(pArgs); } - if (!destroyed) { - m_destroyed = 0; - return Signal0::operator()(); - } + return Signal0::operator()(); } }; @@ -59,8 +51,6 @@ class PSignal1: public PSignal, public Signal1 public: R operator()(V0 a0) { - bool destroyed=false; - m_destroyed = &destroyed; if (m_list) { PyObject *pArgs = PyTuple_New(1); @@ -68,10 +58,7 @@ public: callPython(pArgs); Org_Py_DECREF(pArgs); } - if (!destroyed) { - m_destroyed = 0; - return Signal1::operator()(a0); - } + return Signal1::operator()(a0); } }; @@ -81,8 +68,6 @@ class PSignal2: public PSignal, public Signal2 public: R operator()(V0 a0, V1 a1) { - bool destroyed=false; - m_destroyed = &destroyed; if (m_list) { PyObject *pArgs = PyTuple_New(2); @@ -91,10 +76,7 @@ public: callPython(pArgs); Org_Py_DECREF(pArgs); } - if (!destroyed) { - m_destroyed = 0; - return Signal2::operator()(a0, a1); - } + return Signal2::operator()(a0, a1); } };