summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-04-01 08:32:57 +0000
committerManolo Gouy <Manolo>2011-04-01 08:32:57 +0000
commitf4c12d46d6aa24e8f23c3dd2bfbebbf951625b63 (patch)
treee699c583b4e555e556eeddadb4f16f957f8c7d95 /src
parent885c5fe16d6a2ec832b83d424bf48ffdfb09fb1d (diff)
Mac OS: fixes in STR #2588 the warning message "_createMenuRef called with existing
principal MenuRef already associated with menu". git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8551 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 01696a1c5..e01aa3d19 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -1308,14 +1308,15 @@ void fl_open_display() {
static char beenHereDoneThat = 0;
if ( !beenHereDoneThat ) {
beenHereDoneThat = 1;
-
- [NSApplication sharedApplication];
+
+ BOOL need_new_nsapp = (NSApp == nil);
+ if (need_new_nsapp) [NSApplication sharedApplication];
NSAutoreleasePool *localPool;
localPool = [[NSAutoreleasePool alloc] init]; // never released
mydelegate = [[FLDelegate alloc] init];
[NSApp setDelegate:mydelegate];
- [NSApp finishLaunching];
-
+ if (need_new_nsapp) [NSApp finishLaunching];
+
// empty the event queue but keep system events for drag&drop of files at launch
NSEvent *ign_event;
do ign_event = [NSApp nextEventMatchingMask:(NSAnyEventMask & ~NSSystemDefinedMask)