diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-07-14 16:09:57 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-07-14 16:09:57 +0100 |
commit | 0a888fb732074426d9b0dd6f487dffe5cee9df39 (patch) | |
tree | 5de39993e30eb20955af02f6525e440c59113c33 | |
parent | 1144c656fa9d956853fd8c03dc52937f60d3ee2e (diff) | |
download | dbus-python-0a888fb732074426d9b0dd6f487dffe5cee9df39.tar.gz |
DBusPyServer: Fix refcounting of the main loop
-rw-r--r-- | _dbus_bindings/server.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/_dbus_bindings/server.c b/_dbus_bindings/server.c index 3f32f43..7a45449 100644 --- a/_dbus_bindings/server.c +++ b/_dbus_bindings/server.c @@ -253,9 +253,11 @@ DBusPyServer_NewConsumingDBusServer(PyTypeObject *cls, DBG_WHEREAMI; - self->mainloop = mainloop; self->server = NULL; + self->mainloop = mainloop; + mainloop = NULL; /* don't DECREF it - the DBusServer owns it now */ + ref = PyWeakref_NewRef((PyObject *)self, NULL); if (!ref) goto err; DBG("Created weak ref %p to (Server *)%p for (DBusServer *)%p", @@ -305,7 +307,7 @@ DBusPyServer_NewConsumingDBusServer(PyTypeObject *cls, err: DBG("Failed to construct Server from DBusServer at %p", server); -// Py_XDECREF(mainloop); + Py_XDECREF(mainloop); // Py_XDECREF(self); // Py_XDECREF(ref); if (server) { |