diff --git a/AK/RefCounted.h b/AK/RefCounted.h index 7b45070342..95f7183083 100644 --- a/AK/RefCounted.h +++ b/AK/RefCounted.h @@ -61,7 +61,7 @@ class RefCounted : public RefCountedBase { public: bool unref() const { - auto const* that = static_cast(this); + auto* that = const_cast(static_cast(this)); auto new_ref_count = deref_base(); if (new_ref_count == 0) {