mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: message worker: fix leak
This commit is contained in:
1 file changed
+1
@@ -33,6 +33,7 @@ function initConn(path: string, port: MessagePort, cookie: any) {
|
|||||||
else if (conn && conn.readyState === conn.OPEN) return;
|
else if (conn && conn.readyState === conn.OPEN) return;
|
||||||
lcookie = cookie;
|
lcookie = cookie;
|
||||||
console.log('Init connection for', path);
|
console.log('Init connection for', path);
|
||||||
|
conn?.close();
|
||||||
conn = new ReconnectingWebsocket(path);
|
conn = new ReconnectingWebsocket(path);
|
||||||
ports.push(port);
|
ports.push(port);
|
||||||
conn.onopen = () => conn.send(cookie);
|
conn.onopen = () => conn.send(cookie);
|
||||||
|
|||||||
Reference in new issue
Block a user