[TIMOB-10891] iOS: App having 'tabgroup containing map' crashes when opened from a window (iOS 6)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-10-17T20:17:19.000+0000 |
Affected Version/s | Release 2.1.3 |
Fix Version/s | Release 3.0.0, Release 3.1.0, 2012 Sprint 21 API, 2012 Sprint 21 |
Components | iOS |
Labels | api, module_tabgroup, qe-ios090112, qe-ios6, qe-testadded |
Reporter | Shyam Bhadauria |
Assignee | Vishal Duggal |
Created | 2012-09-13T04:49:01.000+0000 |
Updated | 2013-01-08T14:46:27.000+0000 |
Description
This is not a regression. It happens on 2.1.2 also.
App do not crashes on iOS 5.1
Steps to reproduce:
1. Use the app below
var basewin = Ti.UI.createWindow();
basewin.open();
var openwin1 = Ti.UI.createButton({
title:"Case 1",
});
basewin.add(openwin1);
openwin1.addEventListener('click', function(e) {
var tabGroup = Titanium.UI.createTabGroup();
var _window = Ti.UI.createWindow();
_window.title='Tab 1';
_window.backgroundColor='#fff';
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:_window
});
var regionSV = {latitude:37.337681,longitude:-122.038193,latitudeDelta:0.04, longitudeDelta:0.04};
var mapview = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
animate:true,
region: regionSV,
regionFit:true,
userLocation:true,
visible: true,
});
_window.add(mapview);
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);
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.open();
var close = Ti.UI.createButton({
title:"Close",
bottom:'20dp',
height:'35dp',
width:'180dp'
});
close.addEventListener('click', function(e) {
tabGroup.close();
basewin.open();
});
tabGroup.add(close);
});
2. Run app on iOS 6.Click the 'Case 1' button.
3. Click the 'Close' button.
4. Click the 'Case 1' button again(may need to repeat steps 2 to 4 couple of times).
Expected result
2. After step 2, a tabgroup with a map in first tab will get open.
3. Tabgroup will be closed.Initial window will be displayed.
4. Again the tabgroup with a map in first tab should get open.
Actual result:
2. After step 2, a tabgroup with a map in first tab will get open.
3. Tabgroup will be closed.Initial window is displayed.
4. The tabgroup opens up, but after a while the app also crahes.
Device logs are attached with the bug.
Attachments
File | Date | Size |
---|---|---|
Map1309120457PM.crash | 2012-09-13T04:49:01.000+0000 | 53669 |
On iOS 6 apple changed the mapview engine.Which is not smart enough to stop rendering once the view itself is off screen. Solution is to remove tab after the closing the tabGroup in the close eventListener function. Remove tab will ensure the mapview is removed properly.This doesnot occur with windows because windows detach views on closing.But tabGroups donot detach tabs on closing, since they can be opened again and the expected behavior is to restore the existing tabs again. Modified code snippet.
Marking ticket as invalid.
Recommend documenting it for the release on the 18th, and attempting a better fix for the 28th.
State Retention Test 1. Set memoryTest variable to false 2. Open tabGroup. 3. Open a bunch of windows on either tab. 4. Close Tab Group. 5. Open Tab Group Again Expected result - TabGroup is exactly where we left off. Memory Test 1 1. Set memoryTest variable to true 2. Open Tab Group 3. Close Tab Group 4. Simulate memory warning. Expected result - 1 Button and 1 Window proxy Memory Test 2 1. Set memoryTest variable to true 2. Open Tab Group 3. Switch to Tab2 4. Close Tab Group 5. Simulate memory warning Expected result - 1 Button and 1 Window proxy Memory Test 3 1. Set memoryTest variable to true 2. Open Tab Group 3. Open a bunch of windows on Tab1 4. Close Tab Group 5. Simulate memory warning Expected result - 1 Button and 1 Window proxy Memory Test 4 1. Set memoryTest variable to true 2. Open Tab Group 3. Open a bunch of windows on Tab1 4. Switch to Tab2 5. Close Tab Group 6. Simulate memory warning Expected result - 1 Button and 1 Window proxy Memory Test 5 1. Set memoryTest variable to true 2. Open Tab Group 3. Open a bunch of windows on Tab1 4. Switch to Tab2 5. Open a bunch of windows on Tab2 6. Close Tab Group 7. Simulate memory warning Expected result - 1 Button and 1 Window proxy Test Code below
Pull pending https://github.com/appcelerator/titanium_mobile/pull/3203
3_0_X PR https://github.com/appcelerator/titanium_mobile/pull/3267
3_0_X crash:
closing as fixed. Tested and verified fix with: Titanium Studio, build: 3.0.0.201211301903 Titanium SDK, build: 3.0.0.v20121130200208 Device: iPad mini iOS 6.0.1