Skip to content

Commit

Permalink
fix(ios): remove hacky kroll-leftovers on app-termination
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed Mar 28, 2019
1 parent fcdfcd3 commit 31aace3
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -1006,15 +1006,6 @@ - (void)applicationWillTerminate:(UIApplication *)application
[[TiLogServer defaultLogServer] start];
#endif

// THE CODE BELOW IS WRONG.
// It only waits until ONE context has signialed that it has shut down; then we proceed along our merry way.
// This might lead to problems like contexts not getting cleaned up properly due to premature app termination.
// Plus, it blocks the main thread... meaning that we can have deadlocks if any context is currently executing
// a request that requires operations on the main thread.
[condition lock];
[condition waitUntilDate:[NSDate dateWithTimeIntervalSinceNow:SHUTDOWN_TIMEOUT_IN_SEC]];
[condition unlock];

//This will shut down the modules.
[theNotificationCenter postNotificationName:kTiShutdownNotification object:self];
RELEASE_TO_NIL(condition);
Expand Down

0 comments on commit 31aace3

Please sign in to comment.