My application creates a window with several groups. When the window is closed, the window and its descendants are not collected by the GC.
The Flash Builder profiler helped me find and remove event listeners to such an extent that I cannot detect the problem, because it points to event listeners added from the code of the Window.as library.
In particular, comparing Loitering Objects before opening a window and after closing a window and selecting the MyWin class (1 instance):
MyPackageName.MyWin (10 paths)
10x next line:
Function [savedThis] 569222 GCRoot: Yes bytes: 308
Clicking each "function" in the "Method" panel, I see the following 10 at the top of each "function":
spark.components:Window:creationCompleteHandler() Window.as line 2610 spark.components:Window:creationCompleteHandler() Window.as line 2613 spark.components:Window:creationCompleteHandler() Window.as line 2616 spark.components:Window:creationCompleteHandler() Window.as line 2619 spark.components:Window:creationCompleteHandler() Window.as line 2625 spark.components:Window:creationCompleteHandler() Window.as line 2639 spark.components:Window:creationCompleteHandler() Window.as line 2636 Spark.components.supportClasses:SkinnableComponent:attachSkin() SkinnableComponent.as line 694 Spark.components:SkinnableContainer:partAdded() SkinnableContainter.as line 959 Spark.components:SkinnableContainer:partAdded() SkinnableContainter.as line 957
They are all called from MyWin.initialize () in some way.
I deleted every event listener created by my code and deleted all transitions. but still unable to understand the meaning of this and how I can manage the window. Any help would be greatly appreciated as I struggled for several days.
source share