Here i s little example which shows constant grows number of instance of
WeakMethodClousure... with this rate over night.... hm

<?xml version="1.0"?>
<!-- charts/BasicColumn.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
   <mx:Script><![CDATA[
      import mx.collections.ArrayCollection;
      [Bindable]
      public var expenses:ArrayCollection = new ArrayCollection([
         {Month:"High", Profit:2000},
         {Month:"Low", Profit:1000},
         {Month:"Med", Profit:1500}
      ]);

      private var timer1:Timer = new Timer(1000);


      private function timerGo() {
          timer1.addEventListener(TimerEvent.TIMER, generateData);
          timer1.start();
      }

      private function generateData(event:TimerEvent) {
          expenses.removeAll();
          expenses.addItem({Month:"XXX1", Profit:(Math.random()*10000)});
          expenses.addItem({Month:"XXX2", Profit:(Math.random()*10000)});
          expenses.addItem({Month:"XXX3", Profit:(Math.random()*10000)});
      }

   ]]></mx:Script>
   <mx:Panel title="Column Chart">
      <mx:ColumnChart id="myChart" dataProvider="{expenses}">
         <mx:horizontalAxis>
            <mx:CategoryAxis
                 dataProvider="{expenses}"
                 categoryField="Month"
            />
         </mx:horizontalAxis>
         <mx:series>
            <mx:ColumnSeries
                 xField="Month"
                 yField="Profit"
                 displayName="Profit"
                 fills="[0xFF0000,0x00FF00,0x0000FF]"
            />
         </mx:series>
      </mx:ColumnChart>
      <mx:Legend dataProvider="{myChart}"/>
   </mx:Panel>
   <mx:Button label="Start Timer" click="timerGo();"/>
</mx:Application>

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> If you try to remove a chart and the profiler shows it is still there,
> it is leaking.
>
> If you reset its dataprovider several times and the number of
renderers
> and other objects it creates keeps increasing, there's a leak there.
>
> You just have to keep digging through with the profiler to find the
root
> cause.  Sometimes, building simple test cases help too.
>

Reply via email to