AK: Call deref_base() on the pointer type

This makes it easier to print logs when unrefing a RefCounted type
without rebuilding the world.
This commit is contained in:
Zaggy1024 2026-02-11 17:41:54 -06:00 committed by Gregory Bertilson
parent 2e3c59f791
commit e31fe7804c

View file

@ -59,7 +59,7 @@ public:
{
auto* that = const_cast<T*>(static_cast<T const*>(this));
auto new_ref_count = deref_base();
auto new_ref_count = that->deref_base();
if (new_ref_count == 0) {
if constexpr (requires { that->will_be_destroyed(); })
that->will_be_destroyed();