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:
Ingo Weinhold 2008-07-29 01:48:38 +00:00
parent cfae07b6ac
commit fe00c1a5ea
1 changed files with 2 additions and 2 deletions

View File

@ -134,7 +134,7 @@ struct CObjectDelete
{ {
inline void operator()(Type *object) inline void operator()(Type *object)
{ {
if (fDestructor != NULL) if (fDestructor != NULL && object != NULL)
fDestructor(object); fDestructor(object);
} }
@ -175,7 +175,7 @@ struct MethodDelete
{ {
inline void operator()(Type *object) inline void operator()(Type *object)
{ {
if (fDestructor) if (fDestructor && object != NULL)
(object->*fDestructor)(); (object->*fDestructor)();
} }