Skip to content

Commit

Permalink
Avoid "dropping incoming DO message ..." being logged
Browse files Browse the repository at this point in the history
These warnings were caused by a Vim process sending a DO message and
then immediately exiting so that the process would some times die before
the message was received by MacVim.
  • Loading branch information
b4winckler committed Aug 14, 2008
1 parent a689202 commit 50be9d4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/MacVim/MMBackend.m
Expand Up @@ -58,6 +58,12 @@
static int eventModifierFlagsToVimMouseModMask(int modifierFlags);
static int eventButtonNumberToVimMouseButton(int buttonNumber);

// Before exiting process, sleep for this many microseconds. This is to allow
// any distributed object messages in transit to be received by MacVim before
// the process dies (otherwise an error message is logged by Cocoa). Note that
// this delay is only necessary if an NSConnection to MacVim has been
// established.
static useconds_t MMExitProcessDelay = 300000;

// In gui_macvim.m
vimmenu_T *menu_for_descriptor(NSArray *desc);
Expand Down Expand Up @@ -590,7 +596,6 @@ - (void)exit
NSData *data = [NSData dataWithBytes:&msgid length:sizeof(int)];
NSArray *q = [NSArray arrayWithObjects:data, [NSData data], nil];
[frontendProxy processCommandQueue:q];
//usleep(10000);
}
@catch (NSException *e) {
NSLog(@"Exception caught when sending CloseWindowMsgID: \"%@\"", e);
Expand All @@ -610,6 +615,7 @@ - (void)exit
fontContainerRef = 0;
}

usleep(MMExitProcessDelay);
}

- (void)selectTab:(int)index
Expand Down Expand Up @@ -1544,6 +1550,7 @@ - (void)waitForConnectionAcknowledgement
// NOTE: We intentionally do not call mch_exit() since this in turn
// will lead to -[MMBackend exit] getting called which we want to
// avoid.
usleep(MMExitProcessDelay);
exit(0);
}

Expand Down

0 comments on commit 50be9d4

Please sign in to comment.