facebookincubator / SocketRocket

A conforming Objective-C WebSocket client library.
Other
9.56k stars 2.01k forks source link

Ever increasing Memory usage on reconnect #499

Open maxisme opened 7 years ago

maxisme commented 7 years ago

I am running this every two seconds if there is no connection to the socket:

- (void)openSocket
{
    serverReplied = false;
    streamOpen = false;

    _webSocket.delegate = nil;
    [_webSocket close];

    _webSocket = [[SRWebSocket alloc] initWithURL:[NSURL URLWithString:@"wss://s.notifi.it"]];
    _webSocket.delegate = (id)self;

    [_webSocket open];
}

but this seems to not be freeing up memory after it is called.

I am a massive amateur to freeing up memory in obj-c and am finding it a little confusing atm.