Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changes/bump-flutter-webrtc-1.6.2-hotfix.2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
patch type="changed" "Bump flutter_webrtc to 1.6.2+hotfix.2"
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ packages:
dependency: "direct main"
description:
name: flutter_webrtc
sha256: e997161d7da3adedd3d430691b20931b0b4d96fa48bb60938d9ba0bf6fca98be
sha256: "32bff0d3c6b4dbf2c6d0b1b1f2423c97905259a7013413c700628003c3d2587a"
url: "https://pub.dev"
source: hosted
version: "1.6.0"
version: "1.6.2+hotfix.2"
glob:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies:
json_annotation: ^4.12.0

# Fix version to avoid version conflicts between WebRTC-SDK pods, which both this package and flutter_webrtc depend on.
flutter_webrtc: 1.6.2+hotfix.1
flutter_webrtc: 1.6.2+hotfix.2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Desktop teardown leaks peer connections

On Windows and Linux, flutter_webrtc now requires disposal before close, but Transport keeps the reverse order. The first close removes the native lookup entry, so disposal cannot release its observer. Each teardown retains a peer connection and observer, accumulating native resources across reconnects.

Learn more

The upgraded desktop implementation splits teardown across two platform calls. peerConnectionDispose closes the native connection while its observer remains alive, unregisters that observer, and leaves the connection map entry for peerConnectionClose to remove. Transport disposal sends those calls in the opposite order. The first call removes the map entry, so the second call returns without reaching observer teardown. The observer owns a reference to the native peer connection, leaving both allocated.

Example: A Windows client reconnects ten times. Each old publisher and subscriber transport calls close() before dispose(). All twenty native observers and their peer connections remain retained instead of being released.

Recommended fix: Reverse the calls in Transport so it awaits pc.dispose() before pc.close() on the affected implementation. Verify this ordering on every supported platform, then add a Windows/Linux teardown regression that exercises the SDK's actual Transport sequence.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

dart_webrtc: ^1.8.0

dev_dependencies:
Expand Down
Loading