Skip to content
Snippets Groups Projects
Commit 8131541e authored by Edric Milaret's avatar Edric Milaret
Browse files

macosx: fix exit segfault

Refs #70803

Change-Id: I0471c01493e22ba97b8ad08df4caca7a3aaba223
parent e3fe5396
Branches
Tags
No related merge requests found
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#import "AppDelegate.h" #import "AppDelegate.h"
#import <callmodel.h> #import <callmodel.h>
#import <qapplication.h>
#import <accountmodel.h> #import <accountmodel.h>
#import <protocolmodel.h> #import <protocolmodel.h>
#import <QItemSelectionModel> #import <QItemSelectionModel>
...@@ -54,6 +54,9 @@ ...@@ -54,6 +54,9 @@
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self]; [[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self];
NSAppleEventManager* appleEventManager = [NSAppleEventManager sharedAppleEventManager];
[appleEventManager setEventHandler:self andSelector:@selector(handleQuitEvent:withReplyEvent:) forEventClass:kCoreEventClass andEventID:kAEQuitApplication];
if([self checkForRingAccount]) { if([self checkForRingAccount]) {
[self showMainWindow]; [self showMainWindow];
} else { } else {
...@@ -133,4 +136,16 @@ ...@@ -133,4 +136,16 @@
return YES; return YES;
} }
- (void)handleQuitEvent:(NSAppleEventDescriptor*)event withReplyEvent:(NSAppleEventDescriptor*)replyEvent
{
delete CallModel::instance()->QObject::parent();
[[NSApplication sharedApplication] terminate:self];
}
-(void)applicationWillTerminate:(NSNotification *)notification
{
delete CallModel::instance()->QObject::parent();
[[NSApplication sharedApplication] terminate:self];
}
@end @end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment