File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -759,6 +759,15 @@ - (void)applicationWillTerminate:(NSNotification *)notification
759
759
andEventID: ' MOD ' ];
760
760
#endif
761
761
762
+ // We are hard shutting down the app here by terminating all Vim processes
763
+ // and then just quit without cleanly removing each Vim controller. We
764
+ // don't want the straggler controllers to still interact with the now
765
+ // invalid connections, so we just mark them as uninitialized.
766
+ for (NSUInteger i = 0 , count = [vimControllers count ]; i < count; ++i) {
767
+ MMVimController *vc = [vimControllers objectAtIndex: i];
768
+ [vc uninitialize ];
769
+ }
770
+
762
771
// This will invalidate all connections (since they were spawned from this
763
772
// connection).
764
773
[connection invalidate ];
Original file line number Diff line number Diff line change 57
57
}
58
58
59
59
- (id )initWithBackend : (id )backend pid : (int )processIdentifier ;
60
+ - (void )uninitialize ;
60
61
- (unsigned )vimControllerId ;
61
62
- (id )backendProxy ;
62
63
- (int )pid ;
Original file line number Diff line number Diff line change @@ -248,6 +248,15 @@ - (void)dealloc
248
248
[super dealloc ];
249
249
}
250
250
251
+ // / This should only be called by MMAppController when it's doing an app quit.
252
+ // / We just wait for all Vim processes to terminate instad of individually
253
+ // / closing each MMVimController. We simply unset isInitialized to prevent it
254
+ // / from handling and sending messages to now invalid Vim connections.
255
+ - (void )uninitialize
256
+ {
257
+ isInitialized = NO ;
258
+ }
259
+
251
260
- (unsigned )vimControllerId
252
261
{
253
262
return identifier;
You can’t perform that action at this time.
0 commit comments