Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

onCompleteParams memory management

Recommended Posts

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()



instance = new MyClass();

tw = TweenLite.to(instance, 1, {x:10, onComplete:clearmem, onCompleteParams:[instance]});



private function clearmem(obj:MyClass):void


if (tw != null)



tw = null;




instance = null;




I am using version 12

Link to comment
Share on other sites

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.