Bug 1396071 - check if SourceMapURLService has been destroyed after async call;r=tromey
authorJulian Descottes <jdescottes@mozilla.com>
Sat, 02 Sep 2017 00:59:46 +0200
changeset 428642 4ef59b77d1cbaeae823261ea84dcba5801057c0d
parent 428641 d9f65581eed4c5e0250340ef249bedabe6163c78
child 428643 9170cac02dae16ca52ba3e656d6b90916015f639
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstromey
bugs1396071
milestone57.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 1396071 - check if SourceMapURLService has been destroyed after async call;r=tromey MozReview-Commit-ID: KsKtgvC9LXt
devtools/client/framework/source-map-url-service.js
--- a/devtools/client/framework/source-map-url-service.js
+++ b/devtools/client/framework/source-map-url-service.js
@@ -68,16 +68,21 @@ SourceMapURLService.prototype.destroy = 
   Services.prefs.removeObserver(SOURCE_MAP_PREF, this._onPrefChanged);
   this._target = this._urls = this._subscriptions = null;
 };
 
 /**
  * A helper function that is called when a new source is available.
  */
 SourceMapURLService.prototype._onSourceUpdated = function (_, sourceEvent) {
+  // Maybe we were shut down while waiting.
+  if (!this._urls) {
+    return;
+  }
+
   let { source } = sourceEvent;
   let { generatedUrl, url, actor: id, sourceMapURL } = source;
 
   // |generatedUrl| comes from the actor and is extracted from the
   // source code by SpiderMonkey.
   let seenUrl = generatedUrl || url;
   this._urls.set(seenUrl, { id, url: seenUrl, sourceMapURL });
 };