From 9f1dc941ffe96d53d583d6d5aa8a921f675ba96f Mon Sep 17 00:00:00 2001 From: Stepan Generalov Date: Wed, 12 Jun 2013 18:26:45 -0700 Subject: [PATCH 1/2] Ensure to cleanup properly in -disconnect & -dealloc - fixes crashes --- SocketIO.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SocketIO.m b/SocketIO.m index b4d8164..4612d54 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.delegate = nil; + _handshake = nil; + _host = nil; _sid = nil; _endpoint = nil; + _transport.delegate = nil; _transport = nil; [_timeout invalidate]; From 4ccb970ee78d34230ee8241878332125b83ed130 Mon Sep 17 00:00:00 2001 From: Stepan Generalov Date: Mon, 24 Jun 2013 18:40:19 -0700 Subject: [PATCH 2/2] SocketIO: don't use NSURLConnection delegate property in -dealloc - not available without BlocksKit --- SocketIO.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SocketIO.m b/SocketIO.m index 4612d54..e48cfb8 100755 --- a/SocketIO.m +++ b/SocketIO.m @@ -764,7 +764,7 @@ - (void) connection:(NSURLConnection *)connection - (void) dealloc { - _handshake.delegate = nil; + [_handshake cancel]; _handshake = nil; _host = nil;