Rhymen / go-whatsapp

WhatsApp Web API
MIT License
2.05k stars 490 forks source link

Posible bug - Memory leak on reconnections #606

Closed danielspk closed 2 years ago

danielspk commented 2 years ago

Is it possible that there is a logical path where the socket connection does not close? Example: close (wac.ws.close) is not executed in the Disconnect() function since wac.connected is false but actually the connection to the socket exists?

I have an exponential increase in memory when trying to reestablish connections of devices that are sleeping or without internet (I suspect that the socket is connected and Disconnect() reports that the connection does not exist).

danielspk commented 2 years ago

The flaw was in the logic as it did not explicitly disconnect the connection in the event of certain types of errors.