From 37fd41a721a5417eeb72e90cbe3296f823ccc1b2 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 14 Jul 2008 16:08:26 +0100 Subject: Document that DBusPyServer_NewDBusServer consumes a reference to the server. Rename it to DBusPyServer_NewConsumingDBusServer to make this clearer. --- _dbus_bindings/server.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/_dbus_bindings/server.c b/_dbus_bindings/server.c index 0afa34d..6af462f 100644 --- a/_dbus_bindings/server.c +++ b/_dbus_bindings/server.c @@ -192,12 +192,15 @@ out: * created. For use by the Server constructor. * * Raises AssertionError if the DBusServer already has a Server. + * + * One reference to server is stolen - either the returned DBusPyServer + * claims it, or it's unreffed. */ static PyObject * -DBusPyServer_NewDBusServer(PyTypeObject *cls, - DBusServer *server, - PyObject *mainloop, - PyObject *auth_mechanisms) +DBusPyServer_NewConsumingDBusServer(PyTypeObject *cls, + DBusServer *server, + PyObject *mainloop, + PyObject *auth_mechanisms) { Server *self = NULL; PyObject *ref; @@ -338,7 +341,8 @@ printf("%s:%d\n", __func__, __LINE__); return NULL; } - self = DBusPyServer_NewDBusServer(cls, server, mainloop, auth_mechanisms); + self = DBusPyServer_NewConsumingDBusServer(cls, server, mainloop, + auth_mechanisms); TRACE(self); return self; -- cgit v1.2.1