forked from boostorg/core
Added a check for NULL pointer in fclose_deleter.
The deleter can be called on a null pointer by shared_ptr. Also added tests with unique_ptr from Boost.Move and shared_ptr from Boost.SmartPtr.
This commit is contained in:
@@ -36,7 +36,8 @@ struct fclose_deleter
|
||||
*/
|
||||
void operator() (std::FILE* p) const BOOST_NOEXCEPT
|
||||
{
|
||||
std::fclose(p);
|
||||
if (BOOST_LIKELY(!!p))
|
||||
std::fclose(p);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user