Re: [Flashcoders] Weak eventListener Problem

2009-11-08 Thread Steven Sacks
No, it's not true.  You're misunderstanding how weak listeners work, how 
anonymous functions work (you shouldn't use those anyway), and you're also 
misunderstanding how the garbage collector works.


Whenever you addEventListener, immediately write a function that removes the 
event listener (such as a destroy method).  If you get into this habit, you will 
never forget to do it and you'll never have this issue ever again.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Weak eventListener Problem

2009-11-08 Thread Keith H
I make destroy methods, avoid using extra references to listeners and am 
compulsive about cleaning them up, still some continue to execute 
imperviously.

I hate when this happens cause its unpredictable and unexplainable.

All I know is the Real garbage collectors are sometimes late picking 
up my garbage after I put it outside for them.


-- Keith H --
www.keith-hair.net




Steven Sacks wrote:
No, it's not true.  You're misunderstanding how weak listeners work, 
how anonymous functions work (you shouldn't use those anyway), and 
you're also misunderstanding how the garbage collector works.


Whenever you addEventListener, immediately write a function that 
removes the event listener (such as a destroy method).  If you get 
into this habit, you will never forget to do it and you'll never have 
this issue ever again.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders





___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Weak eventListener Problem

2009-11-08 Thread Ktu
@Steven,
I know anonymous functions are horrible, but I was trying to anything to get
the GC to pick it up.

I'm really just testing, to see how GC might react, and how the weak event
listeners work. I know mediocre practice (and higher) you need to remove
event listeners. I was just wondering, I've made a few classes that use weak
references so that the person using my class does not have to worry about GC
with the object. I wanted to make sure that it works how I thought it would.

Ktu


On Sun, Nov 8, 2009 at 10:59 AM, Keith H kh...@nc.rr.com wrote:

 I make destroy methods, avoid using extra references to listeners and am
 compulsive about cleaning them up, still some continue to execute
 imperviously.
 I hate when this happens cause its unpredictable and unexplainable.

 All I know is the Real garbage collectors are sometimes late picking up
 my garbage after I put it outside for them.

 -- Keith H --
 www.keith-hair.net





 Steven Sacks wrote:

 No, it's not true.  You're misunderstanding how weak listeners work, how
 anonymous functions work (you shouldn't use those anyway), and you're also
 misunderstanding how the garbage collector works.

 Whenever you addEventListener, immediately write a function that removes
 the event listener (such as a destroy method).  If you get into this habit,
 you will never forget to do it and you'll never have this issue ever again.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders