From 81efb6d53e7bf033eb85ba3be24d3dc14e0cc28c Mon Sep 17 00:00:00 2001 From: culler Date: Sat, 25 Nov 2017 23:43:20 +0000 Subject: Repair a mistake introduced in checkin [fc16f8a9]. In TkpInit the NSApplication must be created before opening a console. Otherwise apps launched from an icon will crash. --- macosx/tkMacOSXInit.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 6eba796..7b91f97 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -316,6 +316,24 @@ TkpInit( } /* + * Instantiate our NSApplication object. This needs to be + * done before we check whether to open a console window. + */ + + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + [[NSUserDefaults standardUserDefaults] registerDefaults: + [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES], + @"_NSCanWrapButtonTitles", + [NSNumber numberWithInt:-1], + @"NSStringDrawingTypesetterBehavior", + nil]]; + [TKApplication sharedApplication]; + [pool drain]; + [NSApp _setup:interp]; + [NSApp finishLaunching]; + + /* * If we don't have a TTY and stdin is a special character file of * length 0, (e.g. /dev/null, which is what Finder sets when double * clicking Wish) then use the Tk based console interpreter. @@ -348,22 +366,6 @@ TkpInit( } } - /* - * Instantiate our NSApplication object. - */ - - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - [[NSUserDefaults standardUserDefaults] registerDefaults: - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], - @"_NSCanWrapButtonTitles", - [NSNumber numberWithInt:-1], - @"NSStringDrawingTypesetterBehavior", - nil]]; - [TKApplication sharedApplication]; - [pool drain]; - [NSApp _setup:interp]; - [NSApp finishLaunching]; } Tk_MacOSXSetupTkNotifier(); -- cgit v0.12