diff options
author | Tor Lillqvist <tml@collabora.com> | 2019-10-09 14:21:48 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2019-10-09 14:30:20 +0300 |
commit | 39ddc5242d9378566626d9c3a73e9fda91d1129a (patch) | |
tree | 276d6c2598ed68cfb34e35877ca6ac867e69cc18 /ios | |
parent | 3d5091ca6ca53d6f1b2f1a63e6e4533137a8ea98 (diff) |
tdf#126974: When we are about to be killed, just exit bluntly
Letting the system call exit() will cause destructors of global C++
objects to be called, and doing that at an arbitrary point in time
will cause a crash. So just call std::_Exit() in the AppDelegate's
applicationWillTerminate: method.
Change-Id: I15d7a761db931a6b7aed588bb407fa0d3b4a9465
(cherry picked from commit 4c2cb838ff5fa2485ec74db11e239883a53f7ff9)
Diffstat (limited to 'ios')
-rw-r--r-- | ios/Mobile/AppDelegate.mm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm index 227c895eb..8b9badcc7 100644 --- a/ios/Mobile/AppDelegate.mm +++ b/ios/Mobile/AppDelegate.mm @@ -271,6 +271,9 @@ static void updateTemplates(NSData *data, NSURLResponse *response) } - (void)applicationWillTerminate:(UIApplication *)application { + // tdf#126974 We don't want any global object destructors to be called, the code + // is not prepared for that. + std::_Exit(1); } - (BOOL)application:(UIApplication *)app openURL:(NSURL *)inputURL options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options { |