forcedotcom/SalesforceMobileSDK-iOS — Issue #14: potential crasher when SFOAuthCoordinator calls didFailLoadWithError
Author: tstellanova-sfdc
Created: 2011-12-08 18:48:23+00:00
State: open

Submitted by an SDK user:

If there was an error, didFailLoadWithError in SFOAuthCoordinator.m calls the delegate didFailLoadWithError, which cleaned up the object making self invalid. As a quick fix I just made sure self wasn't referenced after the didFailWithError call:

file:SFOAuthCoordinator.m
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
.....
} else {
NSLog(@"SFOAuthCoordinator:didFailLoadWithError %@ on URL: %@", error, webView.request.URL);
self.authenticating = NO; // moved the line to here
[self.delegate oauthCoordinator:self didFailWithError:error];
// !!used to crash here!! // self.authenticating = NO;
}
}