dbus/mono/DBusType Array.cs, 1.7, 1.8 ObjectPath.cs, 1.6, 1.7 String.cs, 1.4, 1.5

Joe Shaw joe at freedesktop.org
Tue Mar 8 12:45:05 PST 2005


Update of /cvs/dbus/dbus/mono/DBusType
In directory gabe:/tmp/cvs-serv30304/mono/DBusType

Modified Files:
	Array.cs ObjectPath.cs String.cs 
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.
 
        * 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/Array.cs: "Code" is a static member, so
	don't use "this" to refer to it.  Fix for stricter checking
	in Mono 1.1.4.
 
        * mono/DBusType/ObjectPath.cs (Append): Don't leak the
	object path that we pass into unmanaged code.
 
        * mono/DBusType/String.cs (Append): Don't leak the string
	that we pass into unmanged code.

Index: Array.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Array.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Array.cs	25 Jan 2005 19:47:13 -0000	1.7
+++ Array.cs	8 Mar 2005 20:45:03 -0000	1.8
@@ -59,7 +59,7 @@
       IntPtr arrayIter = Marshal.AllocCoTaskMem (Arguments.DBusMessageIterSize);
 
       if (!dbus_message_iter_open_container (iter,
-					     (int) this.Code,
+					     (int) Code,
 					     Arguments.GetCodeAsString (elementType),
 					     arrayIter)) {
 	throw new ApplicationException("Failed to append array argument: " + val);

Index: ObjectPath.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/ObjectPath.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- ObjectPath.cs	25 Jan 2005 19:47:13 -0000	1.6
+++ ObjectPath.cs	8 Mar 2005 20:45:03 -0000	1.7
@@ -52,7 +52,10 @@
     {
       IntPtr marshalVal = Marshal.StringToHGlobalAnsi (Path);
 
-      if (!dbus_message_iter_append_basic (iter, (int) Code, ref marshalVal))
+      bool success = dbus_message_iter_append_basic (iter, (int) Code, ref marshalVal);
+      Marshal.FreeHGlobal (marshalVal);
+
+      if (!success)
 	throw new ApplicationException("Failed to append OBJECT_PATH argument:" + val);
     }
 

Index: String.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/String.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- String.cs	25 Jan 2005 19:47:13 -0000	1.4
+++ String.cs	8 Mar 2005 20:45:03 -0000	1.5
@@ -36,7 +36,10 @@
     {
       IntPtr marshalVal = Marshal.StringToHGlobalAnsi (val);
 
-      if (!dbus_message_iter_append_basic (iter, (int) Code, ref marshalVal))
+      bool success = dbus_message_iter_append_basic (iter, (int) Code, ref marshalVal);
+      Marshal.FreeHGlobal (marshalVal);
+
+      if (!success)
 	throw new ApplicationException("Failed to append STRING argument:" + val);
     }
 



More information about the dbus-commit mailing list