actionscript 3 - How to trigger garbage collection? -


does know if it's possible apply garbage collection new stagevideo component in as3? have tried no success! code below:

if ( this._stagevideo == null ) {     this._stagevideo = stage.stagevideos[0];     this._stagevideo.addeventlistener(stagevideoevent.render_state, stagevideostatechange); } 

attempt @ gc:

this._stagevideo = null; this._stagevideo.removeeventlistener(stagevideoevent.render_state, stagevideostatechange); 

this._stagevideo = null; this._stagevideo.removeeventlistener(stagevideoevent.render_state, stagevideostatechange) 

i'm surprised worked, should throw exception, should first remove event listeners , nullify it's reference.

garbage collector not start every time nullify something, if can use flash builder profiler can attempt force gc, if want test out, can package project air, , call gc manually.

there bug/feature invoke gc if fail start localconnection twice (http://www.nbilyk.com/flash-garbage-collection):

try {     new localconnection().connect('foo');     new localconnection().connect('foo'); } catch (e:error) {} 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -