Added nullptr check to unique_ptr destructor

This commit is contained in:
John Wellbelove 2021-01-23 12:58:57 +00:00
parent c3a055ea75
commit 464cff6238

View File

@ -1256,6 +1256,7 @@ namespace etl
//*********************************
unique_ptr(unique_ptr&& p_) ETL_NOEXCEPT
: p(p_.release())
, deleter(etl::move(p_.deleter))
{
}
#endif
@ -1281,7 +1282,10 @@ namespace etl
//*********************************
~unique_ptr()
{
deleter(p);
if (p != ETL_NULLPTR)
{
deleter(p);
}
}
//*********************************