-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Closing peer connection threads #121
Conversation
When creating a new PeerConnection without a PeerConnectionFactory, network, signaling and worker threads are created. After closing the peer connection, Handler will close those threads if they exist after receiving the OnSignalingChange for "close" state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. @jmillan?
Thanks @pablito25sp! |
You're welcome! Great work of all of you 👏🏻 |
The tests hang up for ever after this change. If I kill the process it seems that Please take a look at it. NOTE: The test binary resides in |
Ok.. Will do. I did not run the test obviously, sorry about that. |
Hey guys, I'm not being able to run tests on my laptop (an M1). And about what I've said before about the callbacks being triggered, I was not accurate. I'm triggering callbacks on my implementation when receiving the OnConnectionStateChange. I've found some similar issues here: https://stackoverflow.com/questions/51275714/webrtc-peerconnectionfactory-graceful-shutdown My question is, would be appropriate to move I can update the PR with this if it makes sense for you. |
Hi @pablito25sp, Deleting the threads on PeerConnection destructor is fine. We are creating them on construction, and doing the oposite on destruction will remove any leak and be consistent. In your approach it seems that |
Could you try the threads removal on PeerConnection destructor? |
I've reverted the commit from v3 for now. |
Regarding to the use-after-free, yes, we need to run valgrind on the the tests. Thanks for the reminder! |
Will do. Thanks for the hint. |
Opened a new one: #122 |
When creating a new PeerConnection without a PeerConnectionFactory, network, signaling and worker threads are created.
After closing the peer connection, Handler will close those threads if they exist after receiving the OnSignalingChange for "close" state.