From 637fd8145202eae79b7131c4aeca51b93a92883c Mon Sep 17 00:00:00 2001 From: sergystepanov Date: Wed, 3 Jun 2026 22:48:30 +0300 Subject: [PATCH] Detach WebRTC handlers before close --- web/js/network/webrtc.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/js/network/webrtc.js b/web/js/network/webrtc.js index b7575b90..fd69cba8 100755 --- a/web/js/network/webrtc.js +++ b/web/js/network/webrtc.js @@ -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; }