diff --git a/SocketIO.m b/SocketIO.m index b4d8164..e48cfb8 100755 --- a/SocketIO.m +++ b/SocketIO.m @@ -163,6 +163,8 @@ - (void) disconnect else if (_isConnecting) { [_handshake cancel]; } + + [self onDisconnect: nil]; } - (void) sendMessage:(NSString *)data @@ -762,10 +764,14 @@ - (void) connection:(NSURLConnection *)connection - (void) dealloc { + [_handshake cancel]; + _handshake = nil; + _host = nil; _sid = nil; _endpoint = nil; + _transport.delegate = nil; _transport = nil; [_timeout invalidate];