From ed0e76444755983f5fdca324b7fb611f54167d21 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Sun, 15 Nov 2009 13:57:34 +0000 Subject: [PATCH] Make terminating on signal via NSApp conditional on NSApp actually existing. This allows you to kill applications with ^C if they are using AppKit but not NSApplication. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@29016 72102866-910b-0410-8b05-ffd578937521 --- Source/x11/XGServer.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/x11/XGServer.m b/Source/x11/XGServer.m index 8949ca7..ad3bd97 100644 --- a/Source/x11/XGServer.m +++ b/Source/x11/XGServer.m @@ -46,7 +46,14 @@ static void terminate(int sig) { - [NSApp terminate: NSApp]; + if (nil != NSApp) + { + [NSApp terminate: NSApp]; + } + else + { + exit(1); + } } #ifdef HAVE_WRASTER_H