mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
Kernel: Unbreak ref counting hooks in ListedRefCounted & RefCounted
We have to mind the constness of the pointer when using "requires" to
check if a member function can be invoked.
I regressed this in c4a0f01b02
.
This commit is contained in:
parent
e53571ef59
commit
5871072ed3
2 changed files with 2 additions and 2 deletions
|
@ -69,7 +69,7 @@ class RefCounted : public RefCountedBase {
|
|||
public:
|
||||
bool unref() const
|
||||
{
|
||||
auto const* that = static_cast<T const*>(this);
|
||||
auto* that = const_cast<T*>(static_cast<T const*>(this));
|
||||
auto new_ref_count = deref_base();
|
||||
if (new_ref_count == 0) {
|
||||
if constexpr (requires { that->will_be_destroyed(); })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue