AdamAtomic / flixel

flixel is a free Actionscript (Flash) library that I distilled from a variety of Flash games that I've worked on over the last couple years, including Gravity Hook, Fathom and Canabalt. It's primary function is to provide some useful base classes that you can extend to make your own game objects.
http://www.flixel.org/
Other
1.13k stars 193 forks source link

Horrible Garbage Collection #89

Closed hamedn closed 14 years ago

hamedn commented 14 years ago

For some reason, classes FlxPoint and FlxRect won't be garbage collected. They keep on filling up my program's memory until it is seriously lagging flash player.

AdamAtomic commented 14 years ago

Can you tell me any more about where these are getting instantiated or how to track this stuff down? thanks!

hamedn commented 14 years ago

Whoops, it was all just cause of my stupidity...

Just added this line to the beginning of the nextLevel() function:

_gravMap.kill() _gravMap = null; _gravMap = new FlxTilemap() _solidMap.kill() _solidMap = null; _solidMap = new FlxTilemap() lyrMaps.members.length = 0;

(_solidMap and _gravMap) are just the tilemaps my game uses.

What is strange though is that this problem just started occuring when I updated

AdamAtomic commented 14 years ago

probably was a change to the way tilemap stores stuff or something? not sure :) thanks for checking that out for me!