Just wondering: does it mean that in the above case the user
has NO way to release the resources associated with that object ?
I guess so.
Test1:
obj = new Object();
obj.onKeyDown = function () { };
Key.addListener(obj);
Key.removeListener(obj);
delete obj;
everything has been deleted as expected.
Test2:
obj = new Object();
obj.onKeyDown = function () { };
Key.addListener(obj);
delete obj; // onKeyDown could be invoked after this, 'obj' is undefined
Key.removeListener(obj); // has not effect, onKeyDown could still be
invoked after this.
On 7/10/07, Sandro Santilli <[EMAIL PROTECTED]> wrote:
On Tue, Jul 10, 2007 at 11:07:00AM +0800, zou lunkai wrote:
> The above testcase does something like this:
>
> obj = new Object();
> obj.onKeyDown = function () { };
> Key.addListener(obj);
> delete obj;
>
> The observed behavious is:
> After deleting 'obj', the onKeyDown event handler could still be
> invoked. So I think the created object is still alive, but without an
> explicit reference.
>
> I'd like to know how GC would deal with this. Knowing this would
> help me find a general solution to fix bug #20317.
Ok. Currently we do NOT keep key listeners alive, assuming they'd
deregister themselves on destruction. Since you're reporting this
is NOT the case, the movie_root::markReachableResources (or the
Key::markReachableResources
in case it relies on the existance of the global Key object) must
be changed to keep listeners alive (mark them as reachable).
See also: http://www.gnashdev.org/wiki/index.php/MemoryManagement#Listeners
Just wondering: does it mean that in the above case the user
has NO way to release the resources associated with that object ?
--strk;
_______________________________________________
Gnash-commit mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash-commit