Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to 'clean up' socket connection to avoid memory leaks, before attempting to reconnect? #832

Open
tackgyu opened this issue Sep 21, 2020 · 0 comments · May be fixed by #1043

Comments

@tackgyu
Copy link

tackgyu commented Sep 21, 2020

Memory leaks found while connecting to invalid socket server url with native engine.
Specifically, NativeEngine instance count increases in Xcode memory graph whenever I try to reconnect to the socket server with the same url.

var socket: WebSocket?

func connect(url: URL) {
    // Disconnect from previous connection
    // FYI. Memory leak also occurs when calling `socket?.forceDisconnect()`
    socket?.disconnect()

    socket = WebSocket(request: ...)
    ...
}
@michaelrevlis michaelrevlis linked a pull request Oct 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant