Skip to content

Commit

Permalink
[TIMOB-20298] iOS:Classic Titanium app with tabs crashes when closed …
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelkPetkov authored and hansemannn committed Feb 5, 2016
1 parent ccb71f1 commit 48305ef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions iphone/Classes/TiApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ TI_INLINE void waitForMemoryPanicCleared() //WARNING: This must never be run o

@property (nonatomic, readonly) TiContextGroupRef contextGroup;

@property (nonatomic,readonly) BOOL willTerminate;
/**
Returns singleton instance of TiApp application object.
*/
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/TiApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ -(void)waitForKrollProcessing
- (void)applicationWillTerminate:(UIApplication *)application
{
NSNotificationCenter * theNotificationCenter = [NSNotificationCenter defaultCenter];

_willTerminate = YES;
//This will send out the 'close' message.
[theNotificationCenter postNotificationName:kTiWillShutdownNotification object:self];
NSCondition *condition = [[NSCondition alloc] init];
Expand Down
4 changes: 3 additions & 1 deletion iphone/Classes/TiUITabProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ -(void)closeWindow:(NSArray*)args
{
TiWindowProxy *window = [args objectAtIndex:0];
ENSURE_TYPE(window,TiWindowProxy);
if (window == rootWindow) {
TiApp* TiAppProxy = [TiApp app];

if (window == rootWindow && ![TiAppProxy willTerminate]) {
DebugLog(@"[ERROR] Can not close root window of the tab. Use removeTab instead");
return;
}
Expand Down

0 comments on commit 48305ef

Please sign in to comment.