mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-09-26 09:58:58 +03:00
The connect() function creates a WebSocket but never stores the reference. The useEffect cleanup only closes the RTCPeerConnection via pcRef, leaving the WebSocket open. Each time the component re-renders with changed deps (camera switch, playback toggle, microphone toggle), a new WebSocket is created without closing the previous one. This leaks connections until the browser garbage-collects them or the server times out. Store the WebSocket in a ref and close it in the cleanup function.