From ab11c166546182f59acee1aceda2c96bde3b0542 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Sat, 18 Oct 2008 14:24:59 +0200 Subject: [PATCH] Delay flushing send queue Ensure that the send queue is flushed after processCommandQueueDidFinish since that method may add messages to the send queue. --- src/MacVim/MMVimController.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/MacVim/MMVimController.m b/src/MacVim/MMVimController.m index 4ece2c7e..b03a138d 100644 --- a/src/MacVim/MMVimController.m +++ b/src/MacVim/MMVimController.m @@ -599,6 +599,13 @@ static BOOL isUnsafeMessage(int msgid); // that did happen anyway, the command queue could get processed out of // order. + // See comment below why this is called here and not later. + [windowController processCommandQueueDidFinish]; + + // NOTE: Ensure that no calls are made after this "if" clause that may call + // sendMessage::. If this happens anyway, such messages will be put on the + // send queue and then the queue will not be flushed until the next time + // this method is called. if ([sendQueue count] > 0) { @try { [backendProxy processInputAndData:sendQueue]; @@ -611,7 +618,6 @@ static BOOL isUnsafeMessage(int msgid); [sendQueue removeAllObjects]; } - [windowController processCommandQueueDidFinish]; [receiveQueue removeAllObjects]; inProcessCommandQueue = NO; } -- 2.11.4.GIT