Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Enlarge try/catch block in connect backend

There have been reports of uncaught exception when the backend connects.
Hopefully these exceptions will no longer go uncaught.
  • Loading branch information...
commit 4bbbab9e567a618250e1a7d77764505e3c561e52 1 parent bd394ba
@b4winckler authored
Showing with 14 additions and 13 deletions.
  1. +14 −13 src/MacVim/MMBackend.m
View
27 src/MacVim/MMBackend.m
@@ -287,28 +287,29 @@ - (BOOL)checkin
}
}
- id proxy = [connection rootProxy];
- [proxy setProtocolForProxy:@protocol(MMAppProtocol)];
+ BOOL ok = NO;
+ @try {
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(connectionDidDie:)
+ name:NSConnectionDidDieNotification object:connection];
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(connectionDidDie:)
- name:NSConnectionDidDieNotification object:connection];
+ id proxy = [connection rootProxy];
+ [proxy setProtocolForProxy:@protocol(MMAppProtocol)];
- int pid = [[NSProcessInfo processInfo] processIdentifier];
+ int pid = [[NSProcessInfo processInfo] processIdentifier];
- @try {
frontendProxy = [proxy connectBackend:self pid:pid];
+ if (frontendProxy) {
+ [frontendProxy retain];
+ [frontendProxy setProtocolForProxy:@protocol(MMAppProtocol)];
+ ok = YES;
+ }
}
@catch (NSException *e) {
NSLog(@"Exception caught when trying to connect backend: \"%@\"", e);
}
- if (frontendProxy) {
- [frontendProxy retain];
- [frontendProxy setProtocolForProxy:@protocol(MMAppProtocol)];
- }
-
- return connection && frontendProxy;
+ return ok;
}
- (BOOL)openVimWindow
Please sign in to comment.
Something went wrong with that request. Please try again.