Author: mhutch
Date: 2007-03-06 18:27:09 -0500 (Tue, 06 Mar 2007)
New Revision: 73857

Modified:
   
trunk/monodevelop/Extras/AspNetEdit/AspNetEdit.Integration/AspNetEditViewContent.cs
   
trunk/monodevelop/Extras/AspNetEdit/AspNetEdit.Integration/MonoDevelopProxy.cs
   trunk/monodevelop/Extras/AspNetEdit/ChangeLog
Log:
2007-03-06  Michael Hutchinson <[EMAIL PROTECTED]>

        * AspNetEdit.Integration/AspNetEditViewContent.cs,
          AspNetEdit.Integration/MonoDevelopProxy.cs:
          Ensure that remoted MonoDevelopProxy object is kept available by 
          overriding InitializeLifetimeService, and make sure to disconnect 
          it afterwards.



Modified: 
trunk/monodevelop/Extras/AspNetEdit/AspNetEdit.Integration/AspNetEditViewContent.cs
===================================================================
--- 
trunk/monodevelop/Extras/AspNetEdit/AspNetEdit.Integration/AspNetEditViewContent.cs
 2007-03-06 23:01:17 UTC (rev 73856)
+++ 
trunk/monodevelop/Extras/AspNetEdit/AspNetEdit.Integration/AspNetEditViewContent.cs
 2007-03-06 23:27:09 UTC (rev 73857)
@@ -138,13 +138,16 @@
                                        textBuf.Text = doc;
                        }
                        
-                       proxy = null;
-                       
                        DestroyEditorAndSockets ();
                }
                
                void DestroyEditorAndSockets ()
                {
+                       if (proxy != null) {
+                               proxy.Dispose ();
+                               proxy = null;
+                       }
+                       
                        if (editorProcess != null) {
                                editorProcess.Dispose ();
                                editorProcess = null;

Modified: 
trunk/monodevelop/Extras/AspNetEdit/AspNetEdit.Integration/MonoDevelopProxy.cs
===================================================================
--- 
trunk/monodevelop/Extras/AspNetEdit/AspNetEdit.Integration/MonoDevelopProxy.cs  
    2007-03-06 23:01:17 UTC (rev 73856)
+++ 
trunk/monodevelop/Extras/AspNetEdit/AspNetEdit.Integration/MonoDevelopProxy.cs  
    2007-03-06 23:27:09 UTC (rev 73857)
@@ -41,7 +41,7 @@
 namespace AspNetEdit.Integration
 {
        
-       public class MonoDevelopProxy : MarshalByRefObject
+       public class MonoDevelopProxy : MarshalByRefObject, IDisposable
        {
                IClass codeBehindClass;
                
@@ -58,6 +58,24 @@
                }               
                #endregion
                
+               //keep this object available through remoting
+               public override object InitializeLifetimeService ()
+               {
+                       return null;
+               }
+               
+               bool disposed = false;
+               public void Dispose ()
+               {
+                       if (disposed)
+                               return;
+                       disposed = true;
+                       
+                       //The proxy uses InitializeLifetimeService to make sure 
it stays connected
+                       //So need to make sure we don't keep it around forever
+                       System.Runtime.Remoting.RemotingServices.Disconnect 
(this);
+               }
+               
                //TODO: make this work with inline code
                #region event binding
                

Modified: trunk/monodevelop/Extras/AspNetEdit/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/AspNetEdit/ChangeLog       2007-03-06 23:01:17 UTC 
(rev 73856)
+++ trunk/monodevelop/Extras/AspNetEdit/ChangeLog       2007-03-06 23:27:09 UTC 
(rev 73857)
@@ -1,3 +1,11 @@
+2007-03-06  Michael Hutchinson <[EMAIL PROTECTED]>
+
+       * AspNetEdit.Integration/AspNetEditViewContent.cs,
+         AspNetEdit.Integration/MonoDevelopProxy.cs:
+         Ensure that remoted MonoDevelopProxy object is kept available by 
+         overriding InitializeLifetimeService, and make sure to disconnect 
+         it afterwards.
+
 2007-03-06  Lluis Sanchez Gual <[EMAIL PROTECTED]> 
 
        * AspNetEdit.mdp: Don't local-copy references.

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to