Procházet zdrojové kódy

ref(conference): clean up rtc listeners on leave

dev1
Leonard Kim před 6 roky
rodič
revize
86e3badd5c
1 změnil soubory, kde provedl 15 přidání a 9 odebrání
  1. 15
    9
      JitsiConference.js

+ 15
- 9
JitsiConference.js Zobrazit soubor

@@ -471,15 +471,21 @@ JitsiConference.prototype.leave = function() {
471 471
 
472 472
         this.room = null;
473 473
 
474
-        return room.leave().catch(error => {
475
-            // remove all participants because currently the conference won't
476
-            // be usable anyway. This is done on success automatically by the
477
-            // ChatRoom instance.
478
-            this.getParticipants().forEach(
479
-                participant => this.onMemberLeft(participant.getJid()));
480
-
481
-            throw error;
482
-        });
474
+        return room.leave()
475
+            .then(() => {
476
+                if (this.rtc) {
477
+                    this.rtc.dispose();
478
+                }
479
+            })
480
+            .catch(error => {
481
+                // remove all participants because currently the conference
482
+                // won't be usable anyway. This is done on success automatically
483
+                // by the ChatRoom instance.
484
+                this.getParticipants().forEach(
485
+                    participant => this.onMemberLeft(participant.getJid()));
486
+
487
+                throw error;
488
+            });
483 489
     }
484 490
 
485 491
     // If this.room == null we are calling second time leave().

Načítá se…
Zrušit
Uložit