2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
authorLluis Sanchez <lluis@novell.com>
Thu, 25 Oct 2007 18:47:30 +0000 (18:47 -0000)
committerLluis Sanchez <lluis@novell.com>
Thu, 25 Oct 2007 18:47:30 +0000 (18:47 -0000)
* AppDomain.cs: In DefaultDomain, wrap the returned domain with
a proxy if the current domain is not the root domain.

svn path=/trunk/mcs/; revision=88215

mcs/class/corlib/System/AppDomain.cs
mcs/class/corlib/System/ChangeLog

index ca85309dfd02920b8a41f36a434e02dd5c5915b7..c52d6f549153cfe00e96576022fccb94324e7334 100644 (file)
@@ -81,6 +81,8 @@ namespace System {
 
                [ThreadStatic]
                private static IPrincipal _principal;
+               
+               static AppDomain default_domain;
 
                private AppDomain ()
                {
@@ -208,7 +210,14 @@ namespace System {
 
                internal static AppDomain DefaultDomain {
                        get {
-                               return getRootDomain ();
+                               if (default_domain == null) {
+                                       AppDomain rd = getRootDomain ();
+                                       if (rd == CurrentDomain)
+                                               default_domain = rd;
+                                       else
+                                               default_domain = (AppDomain) RemotingServices.GetDomainProxy (rd);
+                               }
+                               return default_domain;
                        }
                }
 
index e3523975e5ee019091d9b7a7b5984bdd0a53e9f6..a350c04bb7f9710de7502be0b7a58543bdf9a113 100644 (file)
@@ -1,3 +1,8 @@
+2007-10-25  Lluis Sanchez Gual  <lluis@novell.com>
+
+       * AppDomain.cs: In DefaultDomain, wrap the returned domain with
+       a proxy if the current domain is not the root domain.
+
 2007-10-24  Atsushi Enomoto  <atsushi@ximian.com>
 
        * Type.cs : implemented ReflectionOnlyGetType().