PDA

View Full Version : Remove method doesn't free memory.



granjith
22 Feb 2012, 9:30 PM
Hi All,

I am facing a serious issue while removing and adding new charts in my application, it is not freeing the memory consumed by chart control. Please find the code i have written for removing a chart and adding new chart in a panel in my application.

//Changing type of chart at run time.
var changeChartType = function(selTabPanelId, chartType){
chartTab = Ext.getCmp(selTabPanelId).items.items[0];
var chartData = chartTab.items.items[0].chartInfo;

var removedItem = chartTab.remove(chartTab.items.items[0], true);
removedItem.destroy();
removedItem = null;

var newChart = getChart(chartType, chartData);
chartTab.ownerCt.setActiveItem(chartTab);
chartTab.insert(0, newChart);
chartTab.doComponentLayout();
}

Please anyone help me as soon as possible.

Regards
Ranjith.G