Share Posted November 13, 2012 this a testing class i did cause of have some memory issues on much, much more complicated situation i am currently in and tried this to test my memory leaks and seems MyClass instance doesnt clear it self, but tweenlite, tw is clearing from memory fine. I am just wondering if I am missing anything. I didnt even have to add any thing to stage or do any to find that instance isnt clearing when its called null. and MyClass is an empty class. public class ui extends MovieClip { private var tw:TweenLite; private var instance:MyClass; public function ui() { super(); instance = new MyClass(); tw = TweenLite.to(instance, 1, {x:10, onComplete:clearmem, onCompleteParams:[instance]}); } private function clearmem(obj:MyClass):void { if (tw != null) { tw.kill(); tw = null; } TweenLite.killTweensOf(obj); instance = null; } } I am using version 12 Link to comment Share on other sites More sharing options...
Share Posted November 14, 2012 I don't notice any obvious mistakes that would prevent gc of your object, no. Are you sure you're waiting long enough? Sometimes Flash can take a while to do full, proper gc sweeps. Link to comment Share on other sites More sharing options...
Author Share Posted November 14, 2012 I placed code to force the gc, and even without it I can see the instance of "tw" getting removed, but not the object instance. Link to comment Share on other sites More sharing options...
Share Posted November 15, 2012 Darn. I'm not sure what to tell you. There must be some other code in your app that's preventing proper gc of that object. Or there could be a bug in Flash itself you're running into (although probably not). I wish I had a simple suggestion to offer. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now