[haXe] where is the trash can?
Marcus Bergstrom
marcus at quickform.net
Sun Sep 17 21:02:33 CEST 2006
Niel,
Make sure nothing references the object, such as listeners.
And then delete like this:
myinstance = null;
delete myinstance;
Cleanup in flash can be a bit tricky and cause a lot of problems and
headache. Specially with Singleton. Singleton is baaad, but useful
at times. The thing that happens to me more often than not, is that
I have forgotten to delete the static _instance variable to my class.
Actually, this is how you would do it in AS2, not sure if "delete" also
can be found in haxe. Maybe I'll learn something from your post here...
Marcus
On Sep 17, 2006, at 9:41 PM, Niel Drummond wrote:
> I don't mean the trash can on the desktop of course...
>
> but if you instantiate a class how do you get rid of it ? There is no
> 'delete (myinstance)'...
>
> As I understand it if you do 'myinstance =
> null' that will not remove the instance from memory, or am I wrong?
>
> Kind Regards,
>
> - Niel Drummond
>
> --
> haXe - an open source web programming language
> http://haxe.org
More information about the Haxe
mailing list