Skip to content

fix: do ECClient disconnect in RTCIceConnectionStateClosed only to prevent crash.#75

Open
allenlinli wants to merge 1 commit into
zevarito:masterfrom
allenlinli:feature/moveTimingForECClientDisconnect
Open

fix: do ECClient disconnect in RTCIceConnectionStateClosed only to prevent crash.#75
allenlinli wants to merge 1 commit into
zevarito:masterfrom
allenlinli:feature/moveTimingForECClientDisconnect

Conversation

@allenlinli

@allenlinli allenlinli commented May 30, 2018

Copy link
Copy Markdown
Contributor

I found a bug that it crashes when I disconnect a room.
The bug is described in the issue I sent earlier: #74

I found the reason it crashes is that a block inside ECClient is being released when the ECClient is released(while ECRoom's publishingStatsTimer released, and so that ECRoom and ECClient are released).

So I move the disconnect to RTCIceConnectionStateClosed to prevent this crash.

And after I read the references addressed in this issue (#73), I still didn't find the answer that should both RTCIceConnectionStateDisconnected and RTCIceConnectionStateClosed do disconnect. Since disconnect deallocates ECRoom, and it "probably" always calls RTCIceConnectionStateClosed, we could safely call disconnect at RTCIceConnectionStateClosed.

@allenlinli

Copy link
Copy Markdown
Contributor Author

And so far I couldn't reproduce the crash on your sample code yet.
And also I didn't build WebRTC to get the debug symbol see the backtrace (although I guess it's irrelevant). I will try it later.

@zevarito

zevarito commented Jun 1, 2018

Copy link
Copy Markdown
Owner

thanks @allenlinli! I'll hope to be back on this project next week and review/test all these.

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 this pull request may close these issues.

2 participants