Hi
I created an air application with a schedule.
To populate this schedule with appointment, I launch an httpservice and
result is use to populate an array collection. Each time user change
week, a new request is sending.
The variable myDataCalendar (array collection) is defined as [Bindable]
private var myDataCalendar :ArrayCollection;
I try to reuse the same ArrayCollection, but I think making a mistake
because memory increase each time, and garbage collector seems not working!
myDataCalendar = new ArrayCollection();
myDataCalendar.refresh();
So can you help me to understand memory leak.
Best regards
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (9) |
Combine variable declaration and object creation in single statement. See the below pseudo code for example:
private var myDataCalendar :ArrayCollection=new ArrayCollection();
function ChangeWeekHandler(Event){
myDataCalendar= HttpServiceToGetNextWeekData();
myDataCalendar.refresh();
}
Note: HttpServiceToGetNextWeekData() should return anonymous objectof type ArrayCollection.
Hope this helps. :-)