[*] Remove "Tried to free" null condition under safe delete

This commit is contained in:
Reece Wilson 2023-05-10 18:44:31 +01:00
parent 5e734020d2
commit 6c8bc1d01c

View File

@ -239,8 +239,6 @@ constexpr AuUInt AuSizeOf(const AuSPtr<T>)
return sizeof(T);
}
#if defined(DEBUG) || defined(STAGING)
template <class ... T>
static auline void AU_NORETURN SysPanic(T... args);
@ -251,23 +249,12 @@ static void auline AuSafeDelete(T *in)
if (in == nullptr)
{
Z re;
SysPanic("Tried to free: 0x{:x}, type \"{}\" / \"{}\"", AuUInt(in), typeid(in).name(), typeid(re).name());
return;
}
delete static_cast<Z>(in);
}
#else
template <class Z, typename T>
static void auline AuSafeDelete(T *in)
{
static_assert(AuIsBaseOf_v<T, AuRemovePointer_t<Z>>, "Couldn't not safe delete from type T because it is not derived from Z");
delete static_cast<Z>(in);
}
#endif
// TODO: Move me
#include "auOptional.hpp"