dbus/dbus dbus-connection.c, 1.87.2.2, 1.87.2.3 dbus-pending-call.c,
1.8.2.1, 1.8.2.2
Joe Shaw
joe at freedesktop.org
Tue Mar 8 12:42:23 PST 2005
Update of /cvs/dbus/dbus/dbus
In directory gabe:/tmp/cvs-serv30080/dbus
Modified Files:
Tag: dbus-0-23
dbus-connection.c dbus-pending-call.c
Log Message:
2005-03-08 Joe Shaw <joeshaw at novell.com>
* dbus/dbus-connection.c (dbus_connection_send_with_reply):
After we attach our pending call to the connection, unref
it. Fixes a leak.
* dbus/dbus-pending-call.c (dbus_pending_call_get_reply):
Add this back. Accidentally broke API/ABI compat.
* mono/Connection.cs (set_RawConnection): Disconnect our
filter and match callbacks from the old connection and
reconnect them to the new connection, if any.
* mono/DBusType/ObjectPath.cs (ctor): Don't leak the
object path that we get back from unmanaged code.
(Append): Don't leak the object path that we pass
into unmanaged code.
* mono/DBusType/String.cs (ctor): Don't leak the string
that we get back from unmanaged code.
(Append): Don't leak the string that we pass into
unmanaged code.
Index: dbus-connection.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-connection.c,v
retrieving revision 1.87.2.2
retrieving revision 1.87.2.3
diff -u -d -r1.87.2.2 -r1.87.2.3
--- dbus-connection.c 16 Feb 2005 22:45:40 -0000 1.87.2.2
+++ dbus-connection.c 8 Mar 2005 20:42:21 -0000 1.87.2.3
@@ -2141,6 +2141,8 @@
if (!_dbus_connection_attach_pending_call_unlocked (connection,
pending))
goto error;
+
+ dbus_pending_call_unref (pending);
if (!_dbus_connection_send_unlocked_no_update (connection, message, NULL))
{
Index: dbus-pending-call.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-pending-call.c,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -u -d -r1.8.2.1 -r1.8.2.2
--- dbus-pending-call.c 16 Feb 2005 22:45:40 -0000 1.8.2.1
+++ dbus-pending-call.c 8 Mar 2005 20:42:21 -0000 1.8.2.2
@@ -291,6 +291,24 @@
}
/**
+ * Gets the reply, or returns #NULL if none has been received yet. The
+ * reference count is not incremented on the returned message, so you
+ * have to keep a reference count on the pending call (or add one
+ * to the message).
+ *
+ * @todo not thread safe? I guess it has to lock though it sucks
+ * @todo maybe to make this threadsafe, it should be steal_reply(), i.e. only one thread can ever get the message
+ *
+ * @param pending the pending call
+ * @returns the reply message or #NULL.
+ */
+DBusMessage*
+dbus_pending_call_get_reply (DBusPendingCall *pending)
+{
+ return pending->reply;
+}
+
+/**
* Block until the pending call is completed. The blocking is as with
* dbus_connection_send_with_reply_and_block(); it does not enter the
* main loop or process other messages, it simply waits for the reply
More information about the dbus-commit
mailing list