Bug 1251723 - remove ScopedDeletePtr; r=Waldo

UniquePtr is more standard than ScopedDeletePtr; using standard
constructs whenever possible is preferable.
This commit is contained in:
Nathan Froyd 2016-02-26 15:08:03 -05:00
parent 9e95296e04
commit 76173ee85d

View File

@ -23,9 +23,8 @@
*
* - |ScopedFreePtr| - a container for a pointer, that automatically calls
* |free()| at the end of the scope;
* - |ScopedDeletePtr| - a container for a pointer, that automatically calls
* |delete| at the end of the scope;
*
* |ScopedDeletePtr| is removed in favor of |UniquePtr<T>|.
* |ScopedDeleteArray| is removed in favor of |UniquePtr<T[]>|.
*
* The general scenario for each of the RAII classes is the following:
@ -235,19 +234,6 @@ struct ScopedFreePtrTraits
};
SCOPED_TEMPLATE(ScopedFreePtr, ScopedFreePtrTraits)
/*
* ScopedDeletePtr is a RAII wrapper for pointers that need to be deleted.
*
* struct S { ... };
* ScopedDeletePtr<S> foo = new S();
*/
template<typename T>
struct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>
{
static void release(T* aPtr) { delete aPtr; }
};
SCOPED_TEMPLATE(ScopedDeletePtr, ScopedDeletePtrTraits)
/*
* MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE makes it easy to create scoped
* pointers for types with custom deleters; just overload