Patch from ubuntu

Rob Taylor robtaylor at floopily.org
Fri Mar 17 09:15:08 PST 2006


The attached patch is being used by the Ubuntu dbus package, it seems
right to me. Ok to commit?

Thanks,
Rob Taylor
-------------- next part --------------
--- mono/Connection.cs.old	2006-02-07 18:13:30.886925672 +0100
+++ mono/Connection.cs	2006-02-07 18:14:07.426370832 +0100
@@ -116,7 +116,7 @@
 	// Maybe we already have a Connection object associated with
 	// this rawConnection then return it
 	IntPtr rawThis = dbus_connection_get_data (rawConnection, slot);
-	if (rawThis != IntPtr.Zero) {
+	if (rawThis != IntPtr.Zero && ((GCHandle)rawThis).Target == typeof(DBus.Connection)) {
 	  return (DBus.Connection) ((GCHandle)rawThis).Target;
 	}
       }
--- mono/Message.cs.old	2006-02-07 18:11:27.917619848 +0100
+++ mono/Message.cs	2006-02-07 18:12:36.628174256 +0100
@@ -110,7 +110,7 @@
       if (slot > -1) {
 	// If we already have a Message object associated with this rawMessage then return it
 	IntPtr rawThis = dbus_message_get_data(rawMessage, slot);
-	if (rawThis != IntPtr.Zero)
+	if (rawThis != IntPtr.Zero && ((GCHandle)rawThis).Target == typeof(DBus.Message))
 	  return (DBus.Message) ((GCHandle)rawThis).Target;
       } 
       // If it doesn't exist then create a new Message around it


More information about the dbus mailing list