From b2f6baa64d078f338db0c88084a9147885fd376d Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 21 Apr 2015 20:16:27 -0400 Subject: [PATCH] Bug 1157059 - Avoid calling AddRef on the pointer enclosed in an nsCOMPtr in nsBindingManager::DoProcessAttachedQueue(); r=baku --- dom/xbl/nsBindingManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dom/xbl/nsBindingManager.cpp b/dom/xbl/nsBindingManager.cpp index 55ecf31aa7d2..c339b5f8aef5 100644 --- a/dom/xbl/nsBindingManager.cpp +++ b/dom/xbl/nsBindingManager.cpp @@ -50,6 +50,7 @@ #include "nsThreadUtils.h" #include "mozilla/dom/NodeListBinding.h" #include "mozilla/dom/ScriptSettings.h" +#include "mozilla/unused.h" using namespace mozilla; using namespace mozilla::dom; @@ -405,7 +406,9 @@ nsBindingManager::DoProcessAttachedQueue() } if (NS_SUCCEEDED(rv)) { NS_ADDREF_THIS(); - NS_ADDREF(timer); + // We drop our reference to the timer here, since the timer callback is + // responsible for releasing the object. + unused << timer.forget().take(); } }