File tree 1 file changed +6
-3
lines changed
packages/protocol/src/browser
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ interface ProxyData {
15
15
promise : Promise < void > ;
16
16
instance : any ;
17
17
callbacks : Map < number , ( ...args : any [ ] ) => void > ;
18
+ disposed : boolean ;
18
19
}
19
20
20
21
/**
@@ -174,9 +175,10 @@ export class Client {
174
175
* Make a remote call for a proxy's method using proto.
175
176
*/
176
177
private remoteCall ( proxyId : number | Module , method : string , args : any [ ] ) : Promise < any > {
177
- if ( this . disconnected && typeof proxyId === "number" ) {
178
- // Can assume killing or closing works because a disconnected proxy
179
- // is disposed on the server's side.
178
+ if ( typeof proxyId === "number" && ( this . disconnected || ! this . proxies . has ( proxyId ) ) ) {
179
+ // Can assume killing or closing works because a disconnected proxy is
180
+ // disposed on the server's side, and a non-existent proxy has already
181
+ // been disposed.
180
182
switch ( method ) {
181
183
case "close" :
182
184
case "kill" :
@@ -469,6 +471,7 @@ export class Client {
469
471
promise,
470
472
instance,
471
473
callbacks : new Map ( ) ,
474
+ disposed : false ,
472
475
} ) ;
473
476
474
477
instance . onDone ( ( ) => {
You can’t perform that action at this time.
0 commit comments