Fix of crash when network is unreachable during connecting

This commit is contained in:
aaa 2014-10-13 10:18:30 +01:00
parent 4b99d73adf
commit 7719285010

View File

@ -153,16 +153,16 @@ BOOL wasOpenned = FALSE;
{ {
NSLog(@"Stream event error: %@", [[stream streamError] localizedDescription]); NSLog(@"Stream event error: %@", [[stream streamError] localizedDescription]);
[self close];
if (wasOpenned) { if (wasOpenned) {
self.errorEventHandler([[stream streamError] localizedDescription]); self.errorEventHandler([[stream streamError] localizedDescription]);
self.closeEventHandler(TRUE); self.closeEventHandler(TRUE);
} }
else { else {
self.openErrorEventHandler([[stream streamError] localizedDescription]);
self.errorEventHandler([[stream streamError] localizedDescription]); self.errorEventHandler([[stream streamError] localizedDescription]);
self.openErrorEventHandler([[stream streamError] localizedDescription]);
} }
[self close];
break; break;
} }
default: { default: {