Bug 1150052 - Move up weak reference resolving for garbage collected chatboxes to fix JS errors making Loop cry. r=mixedpuppy, a=lmandel
authorMike de Boer <mdeboer@mozilla.com>
Mon, 11 May 2015 16:20:10 +0200
changeset 274617 21a0c8ae355b64b8fc6643a4d663df4e9e0d07ab
parent 274616 b40e595a89a637cc41f6df430b7cfa03d5d59b2d
child 274618 effb87cfe721ef9bd42c9252d95c804b5df0293c
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy, lmandel
bugs1150052
milestone40.0a2
Bug 1150052 - Move up weak reference resolving for garbage collected chatboxes to fix JS errors making Loop cry. r=mixedpuppy, a=lmandel
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);