8000 Add cleanup for Signaling.close() . · suresh44t/flutter-webrtc@2925a93 · GitHub
[go: up one dir, main page]

8000 Skip to content

Commit 2925a93

Browse files
committed
Add cleanup for Signaling.close() .
1 parent c3fe3db commit 2925a93

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

example/lib/src/call_sample/signaling.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,15 @@ class Signaling {
6464
Signaling(this._url, this._name);
6565

6666
close() {
67-
if (_socket != null) _socket.close();
67+
if (_localStream != null) {
68+
_localStream.dispose();
69+
_localStream = null;
70+
}
71+
_peerConnections.forEach((key, pc){
72+
pc.close();
73+
});
74+
if (_socket != null)
75+
_socket.close();
6876
}
6977

7078
void invite(String peer_id, String media) {

0 commit comments

Comments
 (0)
0