mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 771378 (part 0) - Add ScopedFreePtr to Utility.h. r=jwalden.
--HG-- extra : rebase_source : b43cb64bb1175c4111903f5c30f533612daae841
This commit is contained in:
parent
62d23842f9
commit
a8fffc0cb9
@ -599,11 +599,18 @@ public:
|
||||
class UnwantedForeground : public Foreground {
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct ScopedDeletePtrTraits
|
||||
template<typename T>
|
||||
struct ScopedFreePtrTraits
|
||||
{
|
||||
typedef T* type;
|
||||
static T* empty() { return NULL; }
|
||||
static void release(T* ptr) { Foreground::free_(ptr); }
|
||||
};
|
||||
SCOPED_TEMPLATE(ScopedFreePtr, ScopedFreePtrTraits)
|
||||
|
||||
template <typename T>
|
||||
struct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>
|
||||
{
|
||||
typedef T *type;
|
||||
static T *empty() { return NULL; }
|
||||
static void release(T *ptr) { Foreground::delete_(ptr); }
|
||||
};
|
||||
SCOPED_TEMPLATE(ScopedDeletePtr, ScopedDeletePtrTraits)
|
||||
|
Loading…
Reference in New Issue
Block a user