greensock / GreenSock-AS3

Public repository for GreenSock's ActionScript 3 libraries like GSAP (TweenLite, TweenMax, etc.) and LoaderMax. For AS2, see the GreenSock-AS2 repository and for JavaScript, see the GreenSock-JS repository. Main site: http://www.greensock.com
409 stars 144 forks source link

possible memory leak when loading a SWF #12

Open ghost opened 8 years ago

ghost commented 8 years ago

/** @private **/ protected function _stopMovieClips(obj:DisplayObject):void { var mc:MovieClip = obj as MovieClip; if (mc == null) { return; } mc.stop(); var i:int = mc.numChildren; while (--i > -1) { _stopMovieClips(mc.getChildAt(i)); } } does not work when the main class inherits from Sprite, or contains Sprite

jackdoyle commented 8 years ago

That piece of code is only meant to apply to MovieClips anyway - it just aims to stop() the playhead, that's all. Flash had some memory leak problems when MovieClips weren't stopped (which has nothing to do with LoaderMax). Why do you say that it's a "possible memory leak" in LoaderMax?

ghost commented 8 years ago

I'm sorry, now I saw a method unloadAndStop. but prior to version 10, if we load the SWF where the base class inherits the Sprite, and a few frames, and then when you call unload animation not stops.