3 Replies Latest reply on Apr 23, 2010 4:35 PM by Flex harUI

    PopupManager Titlewindow and Garbage Collection

    RobX82 Level 1

      I am using flex builder 4 and I am trying to simply remove all instances of a Titlewindow opened in a modal using the PopupManager.  After opening the popup I always have 1 instance of it while doing profiling.  I went as far as to remove everything from the titlewindow and I still have the same issue.

       

      Here is the code I am using to show the popup:

                     private var userInfoDialogue:UserInfo;
                     
                     public function ShowUserInfoModal(userID:int, windowText:String):void{
                          
                          //If the modal was created before no need to create it again
                          if(userInfoDialogue==null){
                               userInfoDialogue= new UserInfo();
                          }
                          
                          userInfoDialogue.title=windowText;
                          userInfoDialogue.addEventListener(CloseEvent.CLOSE,ClosePopup,false,0,true);
                          
                          PopUpManager.addPopUp(userInfoDialogue,this,true);
                          PopUpManager.centerPopUp(userInfoDialogue);
                     }
                     
                     protected function ClosePopup(event:Event):void
                     {
                          userInfoDialogue.removeEventListener(CloseEvent.CLOSE,ClosePopup,false);
                          PopUpManager.removePopUp(IFlexDisplayObject(event.currentTarget));
                     }
      

       

      Here is what my Titlewindow looks like:

      <?xml version="1.0" encoding="utf-8"?>
      <s:TitleWindow name="userInfo"
                        xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:mx="library://ns.adobe.com/flex/mx"   
                        width="680" height="530"
                        fontSize="14"
                        cornerRadius="7"
                        >
      
      </s:TitleWindow>