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

Commit

Permalink
Ensure to cleanup properly in -disconnect & -dealloc - fixes crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
psineur committed Jun 13, 2013
1 parent 79fac8e commit 9f1dc94
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SocketIO.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ - (void) disconnect
else if (_isConnecting) {
[_handshake cancel];
}

[self onDisconnect: nil];
}

- (void) sendMessage:(NSString *)data
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 9f1dc94

Please sign in to comment.