Bug 1528323 - Part 1.1: Fix bug in _queueWithClosedCheck where |this| did not refer to the PeerConnection. r=jib
authorByron Campen [:bwc] <docfaraday@gmail.com>
Wed, 27 Feb 2019 16:05:47 +0000
changeset 519347 c998f84e769717ef32c9ef956bab4ab3645488b8
parent 519346 a2c753e0e87199ffbfb0f3754f9f951010051dfe
child 519348 f6a0bad24920fdb2b84b4391a98e7a16cec9d93b
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1528323
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1528323 - Part 1.1: Fix bug in _queueWithClosedCheck where |this| did not refer to the PeerConnection. r=jib Differential Revision: https://phabricator.services.mozilla.com/D21015
dom/media/PeerConnection.jsm
--- a/dom/media/PeerConnection.jsm
+++ b/dom/media/PeerConnection.jsm
@@ -581,20 +581,21 @@ class RTCPeerConnection {
       wrapCallback(onSucc)(await func());
     } catch (e) {
       wrapCallback(onErr)(e);
     }
   }
 
   // This implements the fairly common "Queue a task" logic
   async _queueTaskWithClosedCheck(func) {
+    const pc = this;
     return new this._win.Promise((resolve, reject) => {
       Services.tm.dispatchToMainThread({ run() {
         try {
-          if (!this._closed) {
+          if (!pc._closed) {
             func();
             resolve();
           }
         } catch (e) {
           reject(e);
         }
       }});
     });