From ec5a129c62b75f939830c0585780bdedf7c78460 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Thu, 23 Oct 2008 23:57:36 +0000 Subject: fix garbage collection (Modules/gcmodule.c:380: move_unreachable: Assertion `gc->gc.gc_refs > 0`) --- lib/python/connections.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/python/connections.cpp') 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; } -- cgit v1.2.3