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
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment