|
|
|
(trunk 4 local build r7775)
smokecheck.lzx returns the following in swf7 and swf8 Tests: 845 Failures: 0 Errors: 0 smokecheck.lzx returns the following in dhtml Tests: 836 Failures: 0 Errors: 0 Ran the following testfile successfully in swf and dhtml: <canvas debug="true"> <simplelayout inset="10" axis="x" spacing="2"/> <button y="10" text="Timer" fontstyle="bold"> <handler name="onclick"> this.onclick.clearDelegates(); this.del = new LzDelegate(this, "stopTimer"); this.del.register(this, "onclick"); time.updateTimer(); </handler> <method name="stopTimer"> time.del.disable(); this.onclick.clearDelegates(); this.del = new LzDelegate(this, "restartTimer"); this.del.register(this, "onclick"); </method> <method name="restartTimer"> time.del.enable(); time.updateTimer(this); this.onclick.clearDelegates(); this.del = new LzDelegate(this, "stopTimer"); this.del.register(this, "onclick"); </method> </button> <text name="time" y="10" resize="true" fontsize="14" fontstyle="bold"> <attribute name="elapsedTime" type="number" value="0"/> <method name="updateTimer"> this.setAttribute('text', this.elapsedTime/10); this.elapsedTime++; if (typeof this.del == "undefined"){ this.del = new LzDelegate(this, "updateTimer"); LzTimer.addTimer(this.del, 100);} else LzTimer.resetTimer(this.del, 100); </method> </text> </canvas> |
||||||||||||||||||||||||||||||||||||||||||||||||||||
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 maxcarlson@Roboto.local 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 eventsTechnical 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-5302passes.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) {