*For example, if you attach a click listener
to the stage, using a weak listener, it's possible that it could be
collected before it is ever triggered.
*

My example where I did not use the anonymous function did exactly that. It
appeared that the listener was never assigned, but in reality it was GCed
before you could click.

On Fri, Feb 22, 2008 at 12:34 PM, Rich Shupe <[EMAIL PROTECTED]> wrote:

> Yes, I used the code in iiley's third post, which had that in there. In
> fact, he ran the function twice. I
>
> 've gotten it to collect more often since, and I'm trying to determine if
> it
> has to do with when the listener is being invoked. For example, I seem to
> have different results when I click continuously than when I don't click.
> I
> was wondering if using the listener kept it from being collected, but it's
> not consistent. Again, down to the known issue of unpredictable collecting
>
> This did raise a question, though. If the listener is collected when the
> object to which it is attached is still alive, there may be cases when
> weak
> references are not a good idea. For example, if you attach a click
> listener
> to the stage, using a weak listener, it's possible that it could be
> collected before it is ever triggered.
>
>
> On 2/22/08 12:55 PM, "Keith Peters" wrote:
>
> > Did you try forcing GC using the local connection hack?
>
>
>
>  _______________________________________________
> osflash mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to