recover from exception on iOS and macOS using signals and log the stacktrace
This commit is contained in:
@@ -11,22 +11,6 @@
|
||||
#include "app.h"
|
||||
#include <WTSonarPenDriver.h>
|
||||
|
||||
void global_exception_handler(NSException* e)
|
||||
{
|
||||
if (App::I.canvas && App::I.canvas->m_canvas)
|
||||
App::I.canvas->m_canvas->project_save_thread(App::I.data_path + "/recovery.ppi");
|
||||
|
||||
std::terminate();
|
||||
}
|
||||
|
||||
void global_signal_handler(int e)
|
||||
{
|
||||
if (App::I.canvas && App::I.canvas->m_canvas)
|
||||
App::I.canvas->m_canvas->project_save_thread(App::I.data_path + "/recovery.ppi");
|
||||
|
||||
std::terminate();
|
||||
}
|
||||
|
||||
@interface AppDelegate () {
|
||||
GameViewController* view;
|
||||
WTSonarPenDriver* sonarpen_driver;
|
||||
@@ -68,8 +52,6 @@ void global_signal_handler(int e)
|
||||
}
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
// Override point for customization after application launch.
|
||||
NSSetUncaughtExceptionHandler(&global_exception_handler);
|
||||
// sonarpen_driver = [[WTSonarPenDriver alloc] initWithApplication:application];
|
||||
// [sonarpen_driver start];
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(penStatusChanged) name:WTSonarPenDriverStateChangedNotification object:nil];
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "AppDelegate.h"
|
||||
#include "objc_utils.h"
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
install_global_handlers();
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
||||
}
|
||||
Reference in New Issue
Block a user