Bug 1157848 - Fix leak in OwningNonNull constructor from already_AddRefed; r=bz

This commit is contained in:
Aryeh Gregor 2015-04-24 14:27:34 +03:00
parent 38ec7986e5
commit 0263fdcfc2

View File

@ -29,7 +29,7 @@ public:
template<class U>
MOZ_IMPLICIT OwningNonNull(already_AddRefed<U>&& aValue)
{
init(aValue.take());
init(aValue);
}
// This is no worse than get() in terms of const handling.
@ -106,7 +106,7 @@ public:
protected:
template<typename U>
void init(U aValue)
void init(U&& aValue)
{
mPtr = aValue;
MOZ_ASSERT(mPtr);