File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -316,6 +316,8 @@ class UA extends EventManager {
316316 // If there are session wait a bit so CANCEL/BYE can be sent and their responses received.
317317 int num_sessions = _sessions.length;
318318
319+ _stopping = true ;
320+
319321 // Run _terminate_ on every Session.
320322 _sessions.forEach ((String ? key, _) {
321323 if (_sessions.containsKey (key)) {
@@ -344,8 +346,6 @@ class UA extends EventManager {
344346 }
345347 });
346348
347- _stopping = true ;
348-
349349 // Run _close_ on every applicant.
350350 for (Applicant applicant in _applicants) {
351351 try {
@@ -548,6 +548,9 @@ class UA extends EventManager {
548548 * RTCSession destroyed.
549549 */
550550 void destroyRTCSession (RTCSession session) {
551+ if (_stopping) {
552+ return ;
553+ }
551554 _sessions.remove (session.id);
552555 }
553556
You can’t perform that action at this time.
0 commit comments