Build fix.
Desynchronisation between fs_shell and normal autodeleter files
This commit is contained in:
parent
efc042ff48
commit
5b627acb33
@ -129,41 +129,31 @@ struct MemoryDeleter : AutoDeleter<void, MemoryDelete >
|
|||||||
|
|
||||||
// CObjectDeleter
|
// CObjectDeleter
|
||||||
|
|
||||||
template<typename Type, typename DestructorReturnType>
|
template<typename Type, typename DestructorReturnType,
|
||||||
|
DestructorReturnType (*Destructor)(Type*)>
|
||||||
struct CObjectDelete
|
struct CObjectDelete
|
||||||
{
|
{
|
||||||
inline void operator()(Type *object)
|
inline void operator()(Type *object)
|
||||||
{
|
{
|
||||||
if (fDestructor != NULL && object != NULL)
|
if (object != NULL)
|
||||||
fDestructor(object);
|
Destructor(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Destructor>
|
|
||||||
inline void operator=(Destructor destructor)
|
|
||||||
{
|
|
||||||
fDestructor = destructor;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
DestructorReturnType (*fDestructor)(Type*);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Type, typename DestructorReturnType = void>
|
template<typename Type, typename DestructorReturnType,
|
||||||
|
DestructorReturnType (*Destructor)(Type*)>
|
||||||
struct CObjectDeleter
|
struct CObjectDeleter
|
||||||
: AutoDeleter<Type, CObjectDelete<Type, DestructorReturnType> >
|
: AutoDeleter<Type, CObjectDelete<Type, DestructorReturnType, Destructor> >
|
||||||
{
|
{
|
||||||
typedef AutoDeleter<Type, CObjectDelete<Type, DestructorReturnType> > Base;
|
typedef AutoDeleter<Type,
|
||||||
|
CObjectDelete<Type, DestructorReturnType, Destructor> > Base;
|
||||||
|
|
||||||
template<typename Destructor>
|
CObjectDeleter() : Base()
|
||||||
CObjectDeleter(Destructor destructor) : Base()
|
|
||||||
{
|
{
|
||||||
Base::fDelete = destructor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Destructor>
|
CObjectDeleter(Type *object) : Base(object)
|
||||||
CObjectDeleter(Type *object, Destructor destructor) : Base(object)
|
|
||||||
{
|
{
|
||||||
Base::fDelete = destructor;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user