From 99e0758b1d4f958e5753d51e843f1254e15b93b2 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 31 Jan 2007 13:47:49 +0000 Subject: [PATCH] _dbus_bindings/pending-call.c: Fix memory leak of one Message per method call. Also fix a leak of references to Py_None (unlikely to be a practical problem, but best to be correct). --- _dbus_bindings/pending-call.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_dbus_bindings/pending-call.c b/_dbus_bindings/pending-call.c index b9b7bc1..73071c3 100644 --- a/_dbus_bindings/pending-call.c +++ b/_dbus_bindings/pending-call.c @@ -111,13 +111,14 @@ _pending_call_notify_function(DBusPendingCall *pc, PyErr_Print(); } Py_XDECREF(ret); + Py_DECREF(msg_obj); } /* else OOM has happened - not a lot we can do about that, * except possibly making it fatal (FIXME?) */ } - Py_XDECREF(handler); release: + Py_XDECREF(handler); PyGILState_Release(gil); } @@ -161,7 +162,7 @@ DBusPyPendingCall_ConsumeDBusPendingCall(DBusPendingCall *pc, PyList_SET_ITEM(list, 0, callable); /* INCREF so we can give a ref to set_notify and still have one */ - Py_INCREF(list); + Py_INCREF(list); Py_BEGIN_ALLOW_THREADS ret = dbus_pending_call_set_notify(pc, -- 2.11.4.GIT