Skip to content

Commit 5458dac

Browse files
committed
Fix missing part of dispose logic in DynamicProxyStep
1 parent b72248f commit 5458dac

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/handling/handler-step-impls.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ export class PeerProxyStepImpl extends PeerProxyStep {
251251
export class DynamicProxyStepImpl extends DynamicProxyStep {
252252

253253
async handle(connection: MockRTCConnection) {
254-
await connection.proxyTrafficToExternalConnection();
254+
const externalConn = await connection.proxyTrafficToExternalConnection();
255+
this.externalConnections.push(externalConn);
255256

256257
// This step keeps running indefinitely, until the connection closes
257258
return new Promise<void>((resolve) => connection.on('connection-closed', resolve));

src/webrtc/mockrtc-connection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export class MockRTCConnection extends RTCConnection {
9090
}
9191

9292
await this.proxyTrafficTo(this.externalConnection!);
93+
return this.externalConnection!;
9394
}
9495

9596
async proxyTrafficTo(externalConnection: RTCConnection) {

0 commit comments

Comments
 (0)