* RemotingConfiguration.cs: Avoid adding "id" and "type" as custom
authorLluis Sanchez <lluis@novell.com>
Fri, 2 Jul 2004 15:37:50 +0000 (15:37 -0000)
committerLluis Sanchez <lluis@novell.com>
Fri, 2 Jul 2004 15:37:50 +0000 (15:37 -0000)
  properties of providers. This fixes bug #60934.
* ServerIdentity.cs, RemotingServices.cs: When disposing an identity, detach
  the identity from the object, so it can be safely marshalled again.

svn path=/branches/mono-1-0/mcs/; revision=30685

mcs/class/corlib/System.Runtime.Remoting/ChangeLog
mcs/class/corlib/System.Runtime.Remoting/RemotingConfiguration.cs
mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs
mcs/class/corlib/System.Runtime.Remoting/ServerIdentity.cs

index 1fc62be042d8f1d44aeaa3cebffd3539f72249d3..de3e2e619b5d9d403fabf75525ac4dadfd894261 100755 (executable)
@@ -1,3 +1,10 @@
+2004-07-02  Lluis Sanchez Gual  <lluis@ximian.com>
+
+       * RemotingConfiguration.cs: Avoid adding "id" and "type" as custom 
+         properties of providers. This fixes bug #60934.
+       * ServerIdentity.cs, RemotingServices.cs: When disposing an identity, detach
+         the identity from the object, so it can be safely marshalled again.
+
 2004-06-15  Gert Driesen <drieseng@users.sourceforge.net>
 
        * RemotingTimeoutException.cs: added missing serialization ctor
index 204bc6b4368f17bfa3fc31873a6d1aae6d9ebf78..2cbe62dff510798b71531f5886ed449ad343dcbe 100644 (file)
@@ -721,9 +721,9 @@ namespace System.Runtime.Remoting
                                
                                if (at == "id" && isTemplate)
                                        prov.Id = val;
-                               if (at == "type")
+                               else if (at == "type")
                                        prov.Type = val;
-                               if (at == "ref" && !isTemplate)
+                               else if (at == "ref" && !isTemplate)
                                        prov.Ref = val;
                                else
                                        prov.CustomProperties.Add (at, val);
index aa694cbb3b63b962805b9256409876179ac18203..475164d981a0960e349362e34fb3eca680d06685 100644 (file)
@@ -159,8 +159,10 @@ namespace System.Runtime.Remoting
                                else
                                        throw new ArgumentException ("The obj parameter is a proxy.");
                        }
-                       else
+                       else {
                                identity = obj.ObjectIdentity;
+                               obj.ObjectIdentity = null;
+                       }
 
                        if (identity == null || !identity.IsConnected)
                                return false;
index f5ed96a066b8d5b01272e5ea54b54392bb89965d..72c025121d028f2c048410c8602c60b8fc3b8c19 100644 (file)
@@ -136,7 +136,13 @@ namespace System.Runtime.Remoting
 
                protected void DisposeServerObject()
                {
-                       _serverObject = null;
+                       // Detach identity from server object to avoid problems if the
+                       // object is marshalled again.
+                       
+                       if (_serverObject != null) {
+                               _serverObject.ObjectIdentity = null;
+                               _serverObject = null;
+                       }
                }
        }