2006-04-19 John (J5) Palmieri <johnp@redhat.com>
authorJohn (J5) Palmieri <johnp@redhat.com>
Wed, 19 Apr 2006 16:02:24 +0000 (16:02 +0000)
committerJohn (J5) Palmieri <johnp@redhat.com>
Wed, 19 Apr 2006 16:02:24 +0000 (16:02 +0000)
* mono/Connection.cs, mono/Message.cs: Check Target type
Patch from Aaron Bockover (abockover at novell.com)

ChangeLog
mono/Connection.cs
mono/Message.cs

index d9ba766..710f7f7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-19  John (J5) Palmieri  <johnp@redhat.com>
+
+       * mono/Connection.cs, mono/Message.cs: Check Target type
+       Patch from Aaron Bockover (abockover at novell.com)
+
 2006-04-13  Thiago Macieira  <thiago.macieira@trolltech.com>
 
        * INSTALL: fine-tune the requirements for the Qt4 binding.
index af0764d..5413c1c 100644 (file)
@@ -116,7 +116,7 @@ namespace DBus
        // 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;
        }
       }
index 944e3f9..f9556b5 100644 (file)
@@ -110,7 +110,7 @@ namespace DBus
       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