diff --git a/SocketIO.m b/SocketIO.m index 65640ec..1dfc628 100755 --- a/SocketIO.m +++ b/SocketIO.m @@ -162,6 +162,7 @@ - (void) disconnect } else if (_isConnecting) { [_handshake cancel]; + [self onDisconnect: nil]; } } @@ -786,10 +787,14 @@ - (void) connection:(NSURLConnection *)connection - (void) dealloc { + [_handshake cancel]; + _handshake = nil; + _host = nil; _sid = nil; _endpoint = nil; + _transport.delegate = nil; _transport = nil; [_timeout invalidate];