Added check for NULL pointer in HeapStorage policy.

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@618 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
rich_sposato 2006-03-27 18:38:30 +00:00
parent 5157e66c72
commit f107dafa96

View file

@ -99,8 +99,11 @@ namespace Loki
// (Destruction might be taken over by the OwnershipPolicy) // (Destruction might be taken over by the OwnershipPolicy)
void Destroy() void Destroy()
{ {
pointee_->~T(); if ( 0 != pointee_ )
::free( pointee_ ); {
pointee_->~T();
::free( pointee_ );
}
} }
// Default value to initialize the pointer // Default value to initialize the pointer
@ -1517,6 +1520,9 @@ namespace std
#endif // SMARTPTR_INC_ #endif // SMARTPTR_INC_
// $Log$ // $Log$
// Revision 1.28 2006/03/27 18:38:30 rich_sposato
// Added check for NULL pointer in HeapStorage policy.
//
// Revision 1.27 2006/03/27 18:34:36 rich_sposato // Revision 1.27 2006/03/27 18:34:36 rich_sposato
// Added HeapStorage policy as mentioned in Feature Request 1441024. // Added HeapStorage policy as mentioned in Feature Request 1441024.
// //