Merge pull request #20158 from prlanzarin/u30/fix/crash-videoprovider-onmessage

fix(bbb-html5): crash on video-provider unmount
This commit is contained in:
Anton Georgiev 2024-05-03 08:51:58 -04:00 committed by GitHub
commit 3babf4c16e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View File

@ -226,9 +226,11 @@ class VideoProvider extends Component {
this._isMounted = false;
VideoService.updatePeerDictionaryReference({});
this.ws.onmessage = null;
this.ws.onopen = null;
this.ws.onclose = null;
if (this.ws) {
this.ws.onmessage = null;
this.ws.onopen = null;
this.ws.onclose = null;
}
window.removeEventListener('beforeunload', this.onBeforeUnload);
VideoService.exitVideo(sendUserUnshareWebcam);

View File

@ -229,9 +229,11 @@ class VideoProviderGraphql extends Component {
this._isMounted = false;
VideoService.updatePeerDictionaryReference({});
this.ws.onmessage = null;
this.ws.onopen = null;
this.ws.onclose = null;
if (this.ws) {
this.ws.onmessage = null;
this.ws.onopen = null;
this.ws.onclose = null;
}
window.removeEventListener('beforeunload', this.onBeforeUnload);
exitVideo();