[TIMOB-6208] Open NavigationGroup multiple times crashes the app
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2011-11-22T11:36:24.000+0000 |
Affected Version/s | Release 1.8.0 |
Fix Version/s | Sprint 2011-47, Release 1.8.0.1 |
Components | iOS |
Labels | n/a |
Reporter | Qing Gao |
Assignee | Stephen Tramer |
Created | 2011-11-16T17:44:42.000+0000 |
Updated | 2012-03-30T10:34:37.000+0000 |
Description
When a navigation group is opened multiple times the app crashed. This only happens on 1.8.0 version. I can not repro it on 1.7.5 version.
Repro Steps
Step1. Create a project with the code below and run it on the emulator. Step2. Click the "open" button then click the "back" button. Step3. Repeat Step2 couple of times will crash the app.
function NavGroup(){
var w = Ti.UI.createWindow();
var n = Ti.UI.iPhone.createNavigationGroup();
var win = Ti.UI.createWindow({
backgroundColor:'#444'
});
n.window = win;
var close = Ti.UI.createButton({
title:'back'
});
win.rightNavButton = close;
close.addEventListener('click', function(){
w.close();
});
w.add(n);
return w;
}
function Window(){
var win = Ti.UI.createWindow({backgrounColor:'green'});
var btn = Ti.UI.createButton({
width:100,
height:40,
title:'open'
});
win.add(btn);
btn.addEventListener('click', function(){
NavGroup().open();
});
return win;
}
Window().open();
Associated Helpdesk Ticket
http://appc.me/c/APP-628857Attachments
File | Date | Size |
---|---|---|
NavGroupCrashTest_2011-11-17-131234_qgaombp.crash | 2011-11-17T13:20:39.000+0000 | 37790 |
This ticket should have included a symbolocated crash log.
Attached the crash log.
There is a javascript workaround for this. Changing the
close
event listener:Addressing this issue in the SDK may take substantial time and significant changes, which are being avoided at this point due to partial freeze.
the recommended fix does not work in the context of our application. Please refer to ticket APP-628857 for a zip file that contains a sample application the closely emulates the code we use in our application. I modified the code in settings.js from: function handleClose(_event) { modal.close(); }; to: function handleClose(_event) { navGroup.close(); modal.close(); }; but app still crashes. Console in simulator displays the following after getting the message '[DEBUG] Session did end with error (null)' [FATAL] Orphaned [object TiUIWindow] is trying to forget (null). [FATAL] Orphaned [object TiUIWindow] is trying to forget [object TiUIWindow]. Also, please note there might be duplicate effort on this. Refer to 'APP-687672: Left Nav Button causing app to crash' for similar issue.
refer also to TIMOB-6183 - issue closely mirrors this one. I believe it is the same issue.
Unable to reproduce the crash with either the sample code from this ticket or the sample code provided on the helpdesk, with SDK 1.8.0.1.3e67d33. Tested on iOS simulator 4.3/5.0 and iPod 3GT iOS 5.0. Note that the warning (Orphaned X trying to forget Y) is still logged, but that's acceptable. There's no way around that until we restructure how navgroup works.
Closing issue Tested with Ti Studio build 2.0.0.201203291340 Ti Mobile SDK 2.0.0.v20120329191102 hash r1fbf18c4 OSX Lion 10.7.3 iPhone 4S OS 5.0.1 Cannot reproduce issue