File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ export class Client {
33
33
*/
34
34
readonly #browser_process: Deno . ChildProcess ;
35
35
36
+ #closed = false ;
37
+
36
38
/**
37
39
* The host and port that the websocket server is listening on
38
40
*/
@@ -68,6 +70,10 @@ export class Client {
68
70
errMsg ?: string ,
69
71
errClass : { new ( message : string ) : Error } = Error ,
70
72
) {
73
+ if ( this . #closed) {
74
+ return ;
75
+ }
76
+
71
77
// Close browser process (also closes the ws endpoint, which in turn closes all sockets)
72
78
const p = deferred ( ) ;
73
79
this . #socket. onclose = ( ) => p . resolve ( ) ;
@@ -76,6 +82,7 @@ export class Client {
76
82
this . #browser_process. kill ( ) ;
77
83
await this . #browser_process. status ;
78
84
await p ;
85
+ this . #closed = true ;
79
86
80
87
if ( errMsg ) {
81
88
throw new errClass ( errMsg ) ;
You can’t perform that action at this time.
0 commit comments