Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6208] Open NavigationGroup multiple times crashes the app

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2011-11-22T11:36:24.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-47, Release 1.8.0.1
ComponentsiOS
Labelsn/a
ReporterQing Gao
AssigneeStephen Tramer
Created2011-11-16T17:44:42.000+0000
Updated2012-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-628857

Attachments

FileDateSize
NavGroupCrashTest_2011-11-17-131234_qgaombp.crash2011-11-17T13:20:39.000+000037790

Comments

  1. Reggie Seagraves 2011-11-17

    This ticket should have included a symbolocated crash log.
  2. Qing Gao 2011-11-17

    Attached the crash log.
  3. Stephen Tramer 2011-11-17

    There is a javascript workaround for this. Changing the close event listener:
       	close.addEventListener('click', function(){
       		n.close();
       		w.close();
       	});
       
    Addressing this issue in the SDK may take substantial time and significant changes, which are being avoided at this point due to partial freeze.
  4. Mark Allen 2011-11-18

    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.
  5. Mark Allen 2011-11-18

    refer also to TIMOB-6183 - issue closely mirrors this one. I believe it is the same issue.
  6. Stephen Tramer 2011-11-22

    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.
  7. Michael Pettiford 2012-03-30

    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

JSON Source