Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-20623] iOS: Fix crash during app-termination #8866

Merged
merged 1 commit into from
Mar 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 10 additions & 4 deletions iphone/Classes/TiUITabProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,14 @@ -(void)removeFromTabGroup

- (void)closeWindowProxy:(TiWindowProxy*)window animated:(BOOL)animated
{
[window retain];
UIViewController *windowController = [[window hostingController] retain];
// TIMOB-20623: This can happen when the application is currently
// terminating and the rootWindow property has already been deallocated.
if (!rootWindow) {
return;
}

[window retain];
UIViewController *windowController = [[window hostingController] retain];

// Manage the navigation controller stack
UINavigationController* navController = [[self rootController] navigationController];
Expand All @@ -183,8 +189,8 @@ - (void)closeWindowProxy:(TiWindowProxy*)window animated:(BOOL)animated
// and not let the window simply close by itself. this will ensure that we tell the
// tab that we're doing that
[window close:nil];
RELEASE_TO_NIL_AUTORELEASE(window);
RELEASE_TO_NIL(windowController);
RELEASE_TO_NIL_AUTORELEASE(window);
RELEASE_TO_NIL(windowController);
}

-(void)popGestureStateHandler:(UIGestureRecognizer *)recognizer
Expand Down