Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: Release 1.8.1
-
Fix Version/s: Sprint 2012-04, Release 2.0.0, Release 2.1.0, Release 1.8.2
-
Component/s: iOS
-
Labels:
-
Environment:
Product: Titanium Mobile
Titanium SDK: 1.8.1, 1.9.0 CI
Host OS: Mac OS X Lion
Platform OS: iOS
Platform OS Version: 5.0
-
Story Points:0.5
Description
Memory is not being released when a tab is removed from a tabGroup on iOS using 'removeTab'.
Sample Code
// 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();
|
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.
Attachments
Issue Links
- relates to
-
TIMOB-7152 iOS: Memory Leak: Objects created in a Ti.UI.tabGroup are not released when the tabGroup is closed
-
- Closed
-
-
TIMOB-7791 iOS : TabGroups - Tab group icon and content disappear after running KS > Tab Groups > Close/Animate Tab Group
-
- Closed
-
-
TIMOB-7714 iOS: Window freezing after scrolling back to the first view.
-
- Closed
-
-
TIMOB-7858 iOS: TabProxy is not being released when a tab is removed from tabGroup before it gets the focus
-
- Closed
-