diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-11-25 17:18:48 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-11-25 17:18:48 +0000 |
| commit | 6dcb75c26bbfec04b381bb99d75404f9fe50635d (patch) | |
| tree | b4b0e4e7b92c2d6563a848279cb5b48e7e183f96 /lib/python/connections.cpp | |
| parent | 26a6141301937e0ef501b4cd7ae61b4f2293b7e5 (diff) | |
| download | enigma2-6dcb75c26bbfec04b381bb99d75404f9fe50635d.tar.gz enigma2-6dcb75c26bbfec04b381bb99d75404f9fe50635d.zip | |
python object refcount debugging code second try
Diffstat (limited to 'lib/python/connections.cpp')
| -rw-r--r-- | lib/python/connections.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/lib/python/connections.cpp b/lib/python/connections.cpp index c24c9399..fd3e2a4b 100644 --- a/lib/python/connections.cpp +++ b/lib/python/connections.cpp @@ -1,9 +1,29 @@ #include <lib/python/connections.h> -PSignal1<void,int> testsignal; +PSignal::PSignal() +{ + m_list = PyList_New(0); + Py_INCREF(m_list); +} -void connect(Slot1<void, int> &slot, PyObject *fnc) +PSignal::~PSignal() { - printf("CONNECT !\n"); + Py_DECREF(m_list); } +void PSignal::callPython(ePyObject tuple) +{ + int size = PyList_Size(m_list); + int i; + for (i=0; i<size; ++i) + { + ePyObject b = PyList_GET_ITEM(m_list, i); + ePython::call(b, tuple); + } +} + +PyObject *PSignal::get() +{ + Py_INCREF(m_list); + return m_list; +} |
