Project: titanium
Issue TIMOB-7644: iOS: Memory is not being released when a tab is removed from tabGroup
Memory is not being released when a tab is removed from a tabGroup on iOS using 'removeTab'. *Sample Code* {noformat} // create tab group var tabGroup = Titanium.UI.createTabGroup(); // create base UI tab and root window var win1 = Titanium.UI.createWindow({ title:'Tab 1', backgroundColor:'#fff' }); var tab1 = Titanium.UI.createTab({ icon:'KS_nav_views.png', title:'Tab 1', window:win1 }); var label1 = Titanium.UI.createLabel({ color:'#999', text:'Remove Tab1', font:{fontSize:20,fontFamily:'Helvetica Neue'}, textAlign:'center', width:'auto' }); label1.addEventListener('click', function() { tabGroup.removeTab(tab1); label1 = win1 = tab1 = null; }); win1.add(label1); // create controls tab and root window var win2 = Titanium.UI.createWindow({ title:'Tab 2', backgroundColor:'#fff' }); var tab2 = Titanium.UI.createTab({ icon:'KS_nav_ui.png', title:'Tab 2', window:win2 }); var label2 = Titanium.UI.createLabel({ color:'#999', text:'I am Window 2', font:{fontSize:20,fontFamily:'Helvetica Neue'}, textAlign:'center', width:'auto' }); win2.add(label2); // add tabs tabGroup.addTab(tab1); tabGroup.addTab(tab2); // open tab group tabGroup.open(); {noformat} *STEPS TO REPRODUCE* - Drop the above sample code into app.js. - Start the application and open Instruments to profile it. - Click the 'Remove Tab1' label. - Search for 'proxy' in instruments and it can be seen that tab proxy(along with window and label proxies inside tab1) are not released even if memory warnings are simulated. *EXPECTED BEHAVIOR* Proxies related to tab and elements inside it should be released. *OBSERVED BEHAVIOR* Memory is not being freed.
Story points: 1