PDA

View Full Version : [2.??] Ext.TabPanel bug. Small memory leak



jclawson
19 Aug 2008, 9:20 AM
When closing all tabs in a TabPanel, Ext does not set activeTab to null. getActiveTab will hold on to a reference to the last tab that was closed.

I was using getActiveTab to get a reference to the current tab so that I could destroy it manually. This method was causing a double destroy to happen if there were no tabs open. Many Ext components do not like to be double destroyed / destroyed if they have not yet been rendered so I was getting errors.

Suggested fix: in TabPanel.onRemove validate if there are any tabs open, if not, then set activeTab to null.