Commit 8131541e authored by Edric Milaret's avatar Edric Milaret

macosx: fix exit segfault

Refs #70803

Change-Id: I0471c01493e22ba97b8ad08df4caca7a3aaba223
parent e3fe5396
......@@ -30,7 +30,7 @@
#import "AppDelegate.h"
#import <callmodel.h>
#import <qapplication.h>
#import <accountmodel.h>
#import <protocolmodel.h>
#import <QItemSelectionModel>
......@@ -54,6 +54,9 @@
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self];
NSAppleEventManager* appleEventManager = [NSAppleEventManager sharedAppleEventManager];
[appleEventManager setEventHandler:self andSelector:@selector(handleQuitEvent:withReplyEvent:) forEventClass:kCoreEventClass andEventID:kAEQuitApplication];
if([self checkForRingAccount]) {
[self showMainWindow];
} else {
......@@ -133,4 +136,16 @@
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment