Author: max
Date: 2007-12-21 07:38:05 -0800 (Fri, 21 Dec 2007)
New Revision: 7655

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/events/LaszloEvents.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/services/LzTimer.lzs
Log:
Change 20071220-maxcarlson-X by [EMAIL PROTECTED] on 2007-12-20 13:13:36 PST
    in /Users/maxcarlson/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: UPDATED - Fix enable/disabling of delegates bound to lztimer

New Features:

Bugs Fixed: LPP-5302 - LzTimer ignores disabled events

Technical Reviewer: promanik
QA Reviewer: ptw
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: Check if a context is deleted before executing the delegate.  Add more 
comments to keep track of inlining, fix inlining to match implementation of 
execute().  We need compiler inlining!!!
    

Tests: smoketest and testcase in LPP-5302 passes.



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/events/LaszloEvents.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/events/LaszloEvents.lzs    2007-12-21 
15:30:46 UTC (rev 7654)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/events/LaszloEvents.lzs    2007-12-21 
15:38:05 UTC (rev 7655)
@@ -87,8 +87,9 @@
     // 'resurrect' the deleted view, causing a memory leak
     // Usually this is because a deleted view has idle or timer events
     // still registered.
+    // inlined in LzDelegate.sendEvent(), __LZdrainDelegatesQueue(), and 
LzTimer.addTimer(); 
     var context = this.c;
-    if (context) {
+    if (this.enabled && context) {
         if (context['__LZdeleted']) { 
             return;
         }
@@ -221,7 +222,7 @@
           d.event_called = true; //this delegate has been called
           calledDelegates.push( d );
           // d.execute( sd ); inlined
-          if (d.c[d.f]) d.c[d.f]( sd );
+          if (d.c && ! d.c.__LZdeleted && d.c[d.f]) d.c[d.f]( sd );
         }
         i+=3;
       }
@@ -448,7 +449,7 @@
                   evq.push(this, d, sd);
                 } else {
                   // d.execute( sd ); inlined
-                  if (d.c[d.f]) d.c[d.f]( sd );
+                  if (d.c && ! d.c.__LZdeleted && d.c[d.f]) d.c[d.f]( sd );
                 }
             }
         }

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/services/LzTimer.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/services/LzTimer.lzs       2007-12-21 
15:30:46 UTC (rev 7654)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/services/LzTimer.lzs       2007-12-21 
15:38:05 UTC (rev 7655)
@@ -75,7 +75,12 @@
         // User LzTimer explicitly below; "this" is not the outer function's
         // this here.
         LzTimer.removeTimerWithID(p.delegate, p.id); 
-        p.delegate.execute( (new Date()).getTime() );
+        var del = p.delegate;
+        // Inlining LzDelegate.execute()
+        if (del.enabled && del.c) {
+            //p.delegate.execute( (new Date()).getTime() ); inlined
+            if (! del.c.__LZdeleted && del.c[del.f]) del.c[del.f]( (new 
Date()).getTime() );
+        }
     }
     var id = setInterval(f, milisecs);
     if ($debug) {


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to