From: John (J5) Palmieri Date: Wed, 19 Apr 2006 16:02:24 +0000 (+0000) Subject: 2006-04-19 John (J5) Palmieri X-Git-Tag: dbus-0.62~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3213532f305ca9aad647e84c45ecd7784b22a333;p=thirdparty%2Fdbus.git 2006-04-19 John (J5) Palmieri * mono/Connection.cs, mono/Message.cs: Check Target type Patch from Aaron Bockover (abockover at novell.com) --- diff --git a/ChangeLog b/ChangeLog index d9ba766eb..710f7f7b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-19 John (J5) Palmieri + + * mono/Connection.cs, mono/Message.cs: Check Target type + Patch from Aaron Bockover (abockover at novell.com) + 2006-04-13 Thiago Macieira * INSTALL: fine-tune the requirements for the Qt4 binding. diff --git a/mono/Connection.cs b/mono/Connection.cs index af0764db3..5413c1c83 100644 --- a/mono/Connection.cs +++ b/mono/Connection.cs @@ -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; } } diff --git a/mono/Message.cs b/mono/Message.cs index 944e3f92a..f9556b5da 100644 --- a/mono/Message.cs +++ b/mono/Message.cs @@ -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