diff options
author | Owen Fraser-Green <owen@discobabe.net> | 2004-04-03 22:00:40 +0000 |
---|---|---|
committer | Owen Fraser-Green <owen@discobabe.net> | 2004-04-03 22:00:40 +0000 |
commit | 8056390e00ca6576323d6c41a4dc725bcba9b527 (patch) | |
tree | 719c0a0e7f53427d80dcd621e8ee60714cfc1c9e /mono/Connection.cs | |
parent | 25f384cad92250b744489dd642f39776097da3f3 (diff) |
Made proxy DLL names unique
Diffstat (limited to 'mono/Connection.cs')
-rw-r--r-- | mono/Connection.cs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/mono/Connection.cs b/mono/Connection.cs index 5e25ffd6..fad0dc56 100644 --- a/mono/Connection.cs +++ b/mono/Connection.cs @@ -64,15 +64,16 @@ namespace DBus internal static Connection Wrap(IntPtr rawConnection) { if (slot > -1) { - // If we already have a Connection object associated with this rawConnection then return it + // Maybe we already have a Connection object associated with + // this rawConnection then return it IntPtr rawThis = dbus_connection_get_data (rawConnection, slot); - return (DBus.Connection) ((GCHandle)rawThis).Target; - } - else - { - // If it doesn't exist then create a new connection around it - return new Connection(rawConnection); + if (rawThis != IntPtr.Zero) { + return (DBus.Connection) ((GCHandle)rawThis).Target; } + } + + // If it doesn't exist then create a new connection around it + return new Connection(rawConnection); } public int Timeout |