From 0263fdcfc26195632870ec8a3f92cf349d4411c6 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 24 Apr 2015 14:27:34 +0300 Subject: [PATCH] Bug 1157848 - Fix leak in OwningNonNull constructor from already_AddRefed; r=bz --- dom/bindings/OwningNonNull.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/bindings/OwningNonNull.h b/dom/bindings/OwningNonNull.h index c0b01446f77..ae185bfa315 100644 --- a/dom/bindings/OwningNonNull.h +++ b/dom/bindings/OwningNonNull.h @@ -29,7 +29,7 @@ public: template MOZ_IMPLICIT OwningNonNull(already_AddRefed&& aValue) { - init(aValue.take()); + init(aValue); } // This is no worse than get() in terms of const handling. @@ -106,7 +106,7 @@ public: protected: template - void init(U aValue) + void init(U&& aValue) { mPtr = aValue; MOZ_ASSERT(mPtr);