Detach WebRTC handlers before close

This commit is contained in:
sergystepanov 2026-06-03 22:48:30 +03:00
parent 8c890f0c8e
commit 637fd81452

View file

@ -212,6 +212,13 @@ export const webrtc = {
stream = null;
}
if (pc) {
pc.oniceconnectionstatechange = null;
pc.onicegatheringstatechange = null;
pc.onicecandidate = null;
pc.onicecandidateerror = null;
pc.onconnectionstatechange = null;
pc.ondatachannel = null;
pc.ontrack = null;
pc.close();
pc = null;
}