[Solved, I'm a fool] Memory leak narrowed down to 1 line of code


(Helios) #1

Nothing to see here. I’m not sure how to delete my own topics.

The problem

var path:Vector.<Location> = new <Location>[];

this is local to the update function, which gets called every frame. For some reason, I was expecting this to be automatically destroyed when the update method terminated.

Instead, I just made this an instance variable that gets reassigned every frame and then reset to a default value at the end of the update method.