diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-10-23 23:57:36 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-10-23 23:57:36 +0000 |
| commit | ec5a129c62b75f939830c0585780bdedf7c78460 (patch) | |
| tree | 0654ed5b36d884ab90977b51591761add5c4684d /lib/python | |
| parent | a367a550862868926f84e845940ce2391be415fd (diff) | |
| download | enigma2-ec5a129c62b75f939830c0585780bdedf7c78460.tar.gz enigma2-ec5a129c62b75f939830c0585780bdedf7c78460.zip | |
fix garbage collection (Modules/gcmodule.c:380: move_unreachable: Assertion
`gc->gc.gc_refs > 0`)
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/connections.cpp | 10 | ||||
| -rw-r--r-- | lib/python/connections.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/python/connections.cpp b/lib/python/connections.cpp index 00f33f71..864e5524 100644 --- a/lib/python/connections.cpp +++ b/lib/python/connections.cpp @@ -20,10 +20,12 @@ void PSignal::callPython(ePyObject tuple) } } -PyObject *PSignal::get() +PyObject *PSignal::get(bool steal) { - if (!m_list) - m_list = PyList_New(0); - Py_INCREF(m_list); + if (!steal) { + if (!m_list) + m_list = PyList_New(0); + Py_INCREF(m_list); + } return m_list; } diff --git a/lib/python/connections.h b/lib/python/connections.h index 8ff3a620..76859e7d 100644 --- a/lib/python/connections.h +++ b/lib/python/connections.h @@ -18,7 +18,7 @@ public: PSignal(); ~PSignal(); void callPython(SWIG_PYOBJECT(ePyObject) tuple); - PyObject *get(); + PyObject *get(bool steal=false); }; inline PyObject *PyFrom(int v) |
