Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 9f1dc94

Browse files
committed
Ensure to cleanup properly in -disconnect & -dealloc - fixes crashes
1 parent 79fac8e commit 9f1dc94

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

SocketIO.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ - (void) disconnect
163163
else if (_isConnecting) {
164164
[_handshake cancel];
165165
}
166+
167+
[self onDisconnect: nil];
166168
}
167169

168170
- (void) sendMessage:(NSString *)data
@@ -762,10 +764,14 @@ - (void) connection:(NSURLConnection *)connection
762764

763765
- (void) dealloc
764766
{
767+
_handshake.delegate = nil;
768+
_handshake = nil;
769+
765770
_host = nil;
766771
_sid = nil;
767772
_endpoint = nil;
768773

774+
_transport.delegate = nil;
769775
_transport = nil;
770776

771777
[_timeout invalidate];

0 commit comments

Comments
 (0)