[Laszlo-dev] For Review: Change 20090218-bargull-hTy Summary: use flash.utils.Timer for LzTimeKernel
André Bargull
andre.bargull at udo.edu
Wed Feb 18 09:03:09 PST 2009
On 2/18/2009 4:50 PM, P T Withington wrote:
> This looks great!
>
> Phil: Because we want to integrate this to 4.2.0.2, I'd appreciate it if
> you could be QA reviewer on this.
>
> André: Some questions for my own edification:
>
> 1) In the rest of our code we have used the `cast` operator rather than
> calling the constructor as a function. Is there any reason not to do
> that (i.e., where you say `var timer:LzKernelTimer =
> LzKernelTimer(event.target);`)?
In AS3, the `as` operator returns `null` if the cast-operation failed,
e.g. `(0 cast Sprite)` returns `null`, but if you use `Sprite(0)` a
ClassCastException (or however it's called in AS3) is thrown because a
number cannot be casted to an instance of Sprite. There is also a
performance difference between both cast-operations, but I cannot
remember which one was faster.
>
> 2) Why do you need getter/setter for closure and arguments?
Just added that in case we want/need to provide any default behaviour,
for example for invalid functions.
>
> Approved. Please check in and assign to Phil for QA. Phil, when you
> are satisfied, please assign to me to integrate to 4.2.0.2.
>
>
> On 2009-02-18, at 08:55EST, André Bargull wrote:
>
>> Change 20090218-bargull-hTy by bargull at dell--p4--2-53 on 2009-02-18
>> 02:13:27
>> in /home/Admin/src/svn/openlaszlo/trunk
>> for http://svn.openlaszlo.org/openlaszlo/trunk
>>
>> Summary: use flash.utils.Timer for LzTimeKernel
>>
>> New Features:
>>
>> Bugs Fixed: LPP-7763
>>
>> Technical Reviewer: ptw
>> QA Reviewer: (pending)
>> Doc Reviewer: (pending)
>>
>> Documentation:
>>
>> Release Notes:
>>
>> Details:
>> Changed LzTimeKernelClass#setTimeout, #setInterval, #clearTimeout,
>> #clearInterval to use flash.utils.Timer instead of the functions
>> defined in flash.utils.*
>> It was necessary to change the implementation because the setTimeout
>> etc. functions apparently create memory leaks within the flash player.
>> I created a subclass of flash.utils.Timer so that we can easily
>> identify each instance (timerID property) and to support functions
>> callbacks instead the event based mechanism (closure and arguments
>> property). To reduce the overall number of LzKernelTimer instances up
>> to MAX_POOL (currently set to 10) are cached.
>>
>>
>> Tests:
>> testcase from bugreport, note that cpu usage stays low
>>
>> Files:
>> M WEB-INF/lps/lfc/kernel/swf9/LzTimeKernel.as
>>
>> Changeset:
>> http://svn.openlaszlo.org/openlaszlo/patches/20090218-bargull-hTy.tar
>>
>
>
More information about the Laszlo-dev
mailing list