summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2006-04-19 16:02:24 +0000
committerJohn Palmieri <johnp@remedyz.boston.redhat.com>2006-06-28 08:15:42 -0400
commit5e0deeaabe3ebd098f8ae2a10e88fd47109bd0b9 (patch)
tree77042a9ecb30a036fa3e79fee4b4925a62b99bbb
parentc3fc5f0d0a673e897de0d6bdb1644acc15bb75d7 (diff)
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)
-rw-r--r--mono/Connection.cs2
-rw-r--r--mono/Message.cs2
2 files changed, 2 insertions, 2 deletions
diff --git a/mono/Connection.cs b/mono/Connection.cs
index af0764d..5413c1c 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 944e3f9..f9556b5 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