Bug 1150052: move up weak reference resolving for garbage collected chatboxes to fix JS errors making Loop cry. r=mixedpuppy
authorMike de Boer <mdeboer@mozilla.com>
Mon, 11 May 2015 16:20:10 +0200
changeset 243490 23ec0661bddd3ac9842c4c16182a9e4bcd6ea56a
parent 243489 cf1c3e838ac128e67c9f384767c85ecb35eb38f6
child 243491 3f78f06e37f6f92dc49ad0a53e9485fb8cd604ce
push id28740
push userkwierso@gmail.com
push dateTue, 12 May 2015 23:04:57 +0000
treeherdermozilla-central@de1fd9d0682a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy
bugs1150052
milestone40.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 1150052: move up weak reference resolving for garbage collected chatboxes to fix JS errors making Loop cry. r=mixedpuppy
browser/base/content/socialchat.xml
--- a/browser/base/content/socialchat.xml
+++ b/browser/base/content/socialchat.xml
@@ -550,18 +550,17 @@
       <method name="openChat">
         <parameter name="aOrigin"/>
         <parameter name="aTitle"/>
         <parameter name="aURL"/>
         <parameter name="aMode"/>
         <parameter name="aCallback"/>
         <body><![CDATA[
           let cb = this.chatboxForURL.get(aURL);
-          if (cb) {
-            cb = cb.get();
+          if (cb && (cb = cb.get())) {
             // A chatbox is still alive to us when it's parented and still has
             // content.
             if (cb.parentNode && cb.contentWindow) {
               this.showChat(cb, aMode);
               if (aCallback) {
                 if (cb._callbacks == null) {
                   // Chatbox has already been created, so callback now.
                   aCallback(cb);