AutoDeleter calls the destructor operator also when the object is NULL,
so we need to check for that explicitly in the CObjectDeleter and MethodDeleter cases. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26673 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
cfae07b6ac
commit
fe00c1a5ea
@ -134,7 +134,7 @@ struct CObjectDelete
|
||||
{
|
||||
inline void operator()(Type *object)
|
||||
{
|
||||
if (fDestructor != NULL)
|
||||
if (fDestructor != NULL && object != NULL)
|
||||
fDestructor(object);
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ struct MethodDelete
|
||||
{
|
||||
inline void operator()(Type *object)
|
||||
{
|
||||
if (fDestructor)
|
||||
if (fDestructor && object != NULL)
|
||||
(object->*fDestructor)();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user