Revision: 3789
          http://vexi.svn.sourceforge.net/vexi/?rev=3789&view=rev
Author:   mkpg2
Date:     2010-02-05 15:28:06 +0000 (Fri, 05 Feb 2010)

Log Message:
-----------
Fix. Memory leak.
 
Dubious caching of the Message objects keeping references to old surfaces and 
preventing garbage collection of old surfaces. Fixed size of leak made it hard 
to diagnose as leak was bounded and did not typically cause an out of memory 
failure.

Modified Paths:
--------------
    trunk/core/org.vexi.core/src/org/vexi/core/Surface.java

Modified: trunk/core/org.vexi.core/src/org/vexi/core/Surface.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Surface.java     2010-02-03 
22:25:35 UTC (rev 3788)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Surface.java     2010-02-05 
15:28:06 UTC (rev 3789)
@@ -317,13 +317,11 @@
 
     // Event Message Handlers /////////////////////////////////
     
-    private static Stack eventstack = new Stack();
-    
     /** event message recycler */
     private void message(JS event, JS value) { message(event, null, value, 
false); }
     private void message(JS event, JS _event, JS value) { message(event, 
_event, value, false); }
     private void message(JS event, JS _event, JS value, boolean forceOnRoot) {
-        Message msg = eventstack.empty() ? new Message() : 
(Message)eventstack.pop();
+        Message msg = new Message();
         msg.event = event;
         msg.preevent = _event;
         msg.value = value;
@@ -336,7 +334,7 @@
      *  enabling clipboard access for specific conditions
      *  REMARK: no constructor; use message(JS,JS[,JS,bool])
      */
-    private class Message implements Callable {
+    static private class Message implements Callable {
         private Surface surface;
         private JS event;
         private JS preevent;
@@ -349,7 +347,6 @@
                 if (Interpreter.CASCADE_PREVENTED != ret && (event==SC_Close)) 
{
                     surface.dispose(true);
                 }
-                eventstack.push(this);
                 return o;
             }
             
@@ -381,7 +378,6 @@
                 surface.root.tryPropagateEvent(event, preevent, value, 
forceOnRoot);
             } finally {
                 Platform.clipboardReadEnabled = false;
-                eventstack.push(this);
             }
             return o;
         }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to