2 Replies Latest reply on Dec 28, 2011 5:17 AM by Vikash.kumar29

    Garbage collection problem with Air

    Vikash.kumar29 Level 3

      Hi all,


      I have a titlewindow component added using PopupManager.addPopup method and removed using the removePopup method of PopupManager. When I profile the application using profiler of Flash Builder then I noticed that instances of TitleWidow are not Garbage collected.


      This happens only in the case of Air projects however this is working fine in web projects.


      Just for information I am using Adobe Air 3.1 with Flex Sdk 4.5.1


      For this I have created a sample windowed application and found that same problem persist there.


      Here is my sample code to reproduce the scenario:



      <?xml version="1.0" encoding="utf-8"?>
      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
         import mx.events.FlexEvent;
         import mx.managers.PopUpManager;
         import spark.components.TitleWindow;
         private var tw:TitleWindow;
         protected function button1_clickHandler(event:MouseEvent):void
           tw = new TitleWindow();
          PopUpManager.addPopUp(tw, this);
         protected function button2_clickHandler(event:MouseEvent):void
          tw = null;
        <s:VerticalLayout verticalAlign="middle" horizontalAlign="center" />
       <s:Button label="Add Popup" click="button1_clickHandler(event)"/>
       <s:Button label="Remove Popup" click="button2_clickHandler(event)"/>


      Please do let know, where I am going wrong. Any help will be appreciated.


      -Thanks and Regards

      Vikash kumar