Get your own customer support community
 

Memory leak in MapControls

There seems to be a memory leak in MapControls and it keeps a reference to the Map this prevents the entire map, and its parent, from being garbage collected.

The problem is with attaching the event listener to the stage in onAddedToStage. By making this use a weak reference the problem is solved.

Changed code, lines 130/1:
if (keyboard) stage.addEventListener(KeyboardEvent.KEY_UP, onStageKeyUp, false, 0, true);
if (fullScreen) stage.addEventListener(FullScreenButton.FULL_SCREEN, onFullScreenEvent, false, 0, true);

Note the extra parameters to the addEventListener call.
 
sad
Inappropriate?
1 person has this problem

User_default_medium