Bug 1150052 - Move up weak reference resolving for garbage collected chatboxes to fix JS errors making Loop cry. r=mixedpuppy, a=lizzard
authorMike de Boer <mdeboer@mozilla.com>
Mon, 11 May 2015 16:20:10 +0200
changeset 267484 b1a9307982cb06b8ad6aa8bfd3340b9b27371f95
parent 267483 1e919db8738fcc93c1f8dcd6cb3787496a895a0d
child 267485 a7ee07874c2e6580887ebaedece5c9997f4e7757
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy, lizzard
bugs1150052
milestone39.0
Bug 1150052 - Move up weak reference resolving for garbage collected chatboxes to fix JS errors making Loop cry. r=mixedpuppy, a=lizzard
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);