flex - Spark Combox Memory Leak -
i have simple, reproducable memory leak associated spark combo box, i'm convinced must i'm doing wrong, rather sdk bug.
// application.mxml <?xml version="1.0" encoding="utf-8"?> <s:application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <s:layout> <s:verticallayout /> </s:layout> <fx:script> <![cdata[ import mx.events.flexevent; private var haselement:boolean; protected function togglecontainer():void { if (haselement) { button.setfocus(); comboboxcontainer.removeallelements(); haselement = false; } else { var vew:comboboxview = new comboboxview(); comboboxcontainer.addelement(vew); haselement = true; } } ]]> </fx:script> <s:button id="button" label="add container" click="togglecontainer()" /> <s:group id="comboboxcontainer" /> </s:application> // comboboxview.mxml <?xml version="1.0" encoding="utf-8"?> <s:vgroup xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" > <s:combobox /> </s:vgroup>
when compiled against flex 4.1, appears create memory leak, comboboxview never gc'd -- because of lingering reference combobox.
here's output profiler:
steps reproduce:
- create project
application.mxml
,comboboxview.mxml
- compile project flex 4.1
- launch application.mxml profiler
- create memory snapshot
- click button add view stage
- click button again remvoe view stage
- run garbage collector
- create memory snapshot
- view lingering objects between 2 memory snapshots
note - doesn't occur when application compiled against flex hero.
it appears though bug, cannot believe combobox has memory leak -- surely would've been fixed before 4.1 shipped?
what doing wrong here? why isn't view being gc'd?
update i've done further investigation this, , believe issue lies in problem richeditabletext component comboboxskin uses. see details here: spark memory leaks
http://www.iampj.com/search/label/combobox%20memory%20leak
i have been having similar problems in flex 3
Comments
Post a Comment