Howdy all!
I've got a memory leak issue with my problem. I just added a third
party countdown timer component to my project. I've narrowed down the
culprit to the event listener that listens for the timer event and
then calls an updateTime function.
timer.addEventListener("timer", updateTime, false, 0, true);
As you can see, it uses a weak reference, as it should.
The updateTime function declares two event objects, and checks if the
timer has reached zero. It either stops the timer and throws a
completed event, or it throws an event to update the visual component
to the new time.
Removing the addEventListener function plugs the leak, but the visual
component never gets updated. I've moved the declarations of the two
events from within the updateTime to the class itself to stop the
timer from creating new objects every time it fires, but the app still
leaks.
It seems that everything is technically correct, but calling a
function evey second is just devouring memory. So I guess I'm looking
for a workaround to update the display without an event
listener....yeah that may be impossible...
Any suggestions?