5 Replies Latest reply: Sep 13, 2012 3:19 AM by nikos101 RSS

    ArrayCollection removeAll() causes crash

    nikos101 Community Member

      Hi

       

      arrayCollection.removeAll() causes a crash, its is asssigned to a AD grid :

       

       

                               dataProvider="{clientSessionModel.processedOrders}"

       

       

       

       

      public function set processedOrders(value:ArrayCollection):void

              {

                  trace("_processedOrders set.");

                 _processedOrders.removeAll();

                  _processedOrders.source=value.source;

             

              }

       

      any idea friends?

        • 1. Re: ArrayCollection removeAll() causes crash
          John Hall Community Member

          Maybe because it's bound to the grid at it's crashing. How about just = new ArrayCollection()

          • 2. Re: ArrayCollection removeAll() causes crash
            Flex harUI Adobe Employee

            What is the stack trace?

            • 3. Re: ArrayCollection removeAll() causes crash
              nikos101 Community Member

              Hi mate

               

              Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.

                  at mx.collections::GroupingCollection/getChildren()[E:\dev\4.y\frameworks\projects\advancedg rids\src\mx\collections\GroupingCollection.as:440]

                  at mx.collections::GroupingCollection/getSummaries()[E:\dev\4.y\frameworks\projects\advanced grids\src\mx\collections\GroupingCollection.as:887]

                  at mx.collections::GroupingCollection/updateSummary()[E:\dev\4.y\frameworks\projects\advance dgrids\src\mx\collections\GroupingCollection.as:1635]

                  at mx.collections::GroupingCollection/collectionChangeHandler()[E:\dev\4.y\frameworks\projec ts\advancedgrids\src\mx\collections\GroupingCollection.as:1713]

                  at flash.events::EventDispatcher/dispatchEventFunction()

                  at flash.events::EventDispatcher/dispatchEvent()

                  at mx.collections::ListCollectionView/dispatchEvent()[E:\dev\4.y\frameworks\projects\framewo rk\src\mx\collections\ListCollectionView.as:1024]

                  at mx.collections::ListCollectionView/removeItemsFromView()[E:\dev\4.y\frameworks\projects\f ramework\src\mx\collections\ListCollectionView.as:1697]

                  at mx.collections::ListCollectionView/listChangeHandler()[E:\dev\4.y\frameworks\projects\fra mework\src\mx\collections\ListCollectionView.as:1308]

                  at flash.events::EventDispatcher/dispatchEventFunction()

                  at flash.events::EventDispatcher/dispatchEvent()

                  at mx.collections::ArrayList/internalDispatchEvent()[E:\dev\4.y\frameworks\projects\framewor k\src\mx\collections\ArrayList.as:682]

                  at mx.collections::ArrayList/removeItemAt()[E:\dev\4.y\frameworks\projects\framework\src\mx\ collections\ArrayList.as:495]

                  at mx.collections::ListCollectionView/removeItemAt()[E:\dev\4.y\frameworks\projects\framewor k\src\mx\collections\ListCollectionView.as:762]

                  at mx.collections::ListCollectionView/removeAll()[E:\dev\4.y\frameworks\projects\framework\s rc\mx\collections\ListCollectionView.as:782]

              ...

              • 4. Re: ArrayCollection removeAll() causes crash
                Flex harUI Adobe Employee

                You sure that’s the full stack?  I’m wondering if you are causing a loop?  Or maybe it is just take a long time to recompute the groupings?

                • 5. Re: ArrayCollection removeAll() causes crash
                  nikos101 Community Member

                  I hid the rest of the trace.

                   

                  I decided to dump the GC's, that solved it, my users weren't using the Gc's

                   

                  thx anyhoo!