Bug 1304201, r=nfroyd
authorMyk Melez <myk@mykzilla.org>
Tue, 04 Oct 2016 12:10:26 +0200
changeset 343130 8e77884e08283e644582bfdbbe45e5338034374f
parent 343129 24953f3dbcb1854c065c2a64521b81672e95b0d1
child 343131 64d86a1d172d80b8467c1ab015ebe04acb831185
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnfroyd
bugs1304201
milestone52.0a1
Bug 1304201, r=nfroyd
embedding/browser/nsWebBrowser.cpp
--- a/embedding/browser/nsWebBrowser.cpp
+++ b/embedding/browser/nsWebBrowser.cpp
@@ -240,18 +240,18 @@ nsWebBrowser::RemoveWebBrowserListener(n
     // sense.
     if (!mListenerArray) {
       return NS_ERROR_FAILURE;
     }
 
     // iterate the array and remove the queued listener
     int32_t count = mListenerArray->Length();
     while (count > 0) {
-      if (mListenerArray->ElementAt(count).Equals(aListener, aIID)) {
-        mListenerArray->RemoveElementAt(count);
+      if (mListenerArray->ElementAt(count-1).Equals(aListener, aIID)) {
+        mListenerArray->RemoveElementAt(count-1);
         break;
       }
       count--;
     }
 
     // if we've emptied the array, get rid of it.
     if (0 >= mListenerArray->Length()) {
       mListenerArray = nullptr;