@actuallab/rpc 12.3.76 → 12.3.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2259,6 +2259,7 @@ var RpcPeer = class {
2259
2259
  this._connection = conn;
2260
2260
  conn.messageReceived.add((raw) => this._handleMessage(raw));
2261
2261
  conn.closed.add((ev) => {
2262
+ if (this._connection !== conn) return;
2262
2263
  this._connection = void 0;
2263
2264
  this._isConnected = false;
2264
2265
  if (ev.reason)
@@ -2877,6 +2878,7 @@ var RpcServerPeer = class extends RpcPeer {
2877
2878
  this._setConnectionState(1 /* Connecting */);
2878
2879
  this.setupConnection(conn);
2879
2880
  conn.closed.add(() => {
2881
+ if (this._connection !== conn && this._connection !== void 0) return;
2880
2882
  this.sharedObjects.disconnectAll();
2881
2883
  });
2882
2884
  }