mirror of
https://github.com/boostorg/functional.git
synced 2025-07-30 04:27:18 +02:00
Don't call deallocate with null pointers
This commit is contained in:
@ -116,13 +116,15 @@ namespace boost
|
|||||||
|
|
||||||
void operator()(value_type* ptr) const
|
void operator()(value_type* ptr) const
|
||||||
{
|
{
|
||||||
if (!! ptr) ptr->~value_type();
|
if (!! ptr) {
|
||||||
|
ptr->~value_type();
|
||||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||||
const_cast<allocator_type*>(static_cast<allocator_type const*>(
|
const_cast<allocator_type*>(static_cast<allocator_type const*>(
|
||||||
this))->deallocate(ptr,1);
|
this))->deallocate(ptr,1);
|
||||||
#else
|
#else
|
||||||
allocator_traits::deallocate(this->get_allocator(),ptr,1);
|
allocator_traits::deallocate(this->get_allocator(),ptr,1);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user