0 Replies Latest reply on Mar 26, 2010 2:38 PM by kati.sun

    ComboBox delete from memory

    kati.sun

      Hi

       

      Have got page where many times add/remove combobox. Unfortunately in cases when 'user':

       

      1)add text to TextInput

      2)'interact' with combobox

       

      Profile is showing that instance of class ListCollectionViewCursor is not removed. But when there is no any of above interaction instance of class ListCollectionViewCursor is removed

       

       

       

      Simple test :

      1) when page loaded click 'remove combobox' - you will see that ListCollectionViewCursor is removed

      2) when page loaded add some text to TextInput then click 'remove combobox' - you will see that  ListCollectionViewCursor is not removed

       

      What I am doing wrong?

       

      CODE:

       

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
          <![CDATA[
             
              private function remove():void{
                  if(_combobox !=null){
                     _container.removeChild(_combobox)
                     _combobox = null;
               }
                  try {                   
                         new LocalConnection().connect('foo');
                         new LocalConnection().connect('foo');
                      } catch (e:*) {}
              }       
          ]]>
      </mx:Script>
         
         
      <mx:VBox id="_container">   
         
          <mx:HBox>
              <mx:Button click="remove()" label="remove combobox" />
              <mx:TextInput id="_textFocus"/>
          </mx:HBox>

       

           <mx:ComboBox id="_combobox"   width="265" height="33" >
               <mx:ArrayCollection id="_comboboxAC">
                   <mx:String>text</mx:String>
                   <mx:String>text</mx:String>
               </mx:ArrayCollection>
           </mx:ComboBox>
      </mx:VBox>   
      </mx:Application>