1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:37:34 +00:00

AK: Let's call decrementing reference counts "unref" instead of "deref"

It always bothered me that we're using the overloaded "dereference"
term for this. Let's call it "unreference" instead. :^)
This commit is contained in:
Andreas Kling 2020-01-23 15:14:21 +01:00
parent 4aa1b5b40e
commit 3de5439579
12 changed files with 24 additions and 24 deletions

View file

@ -61,13 +61,13 @@ void GVariant::clear()
{
switch (m_type) {
case Type::String:
AK::deref_if_not_null(m_value.as_string);
AK::unref_if_not_null(m_value.as_string);
break;
case Type::Bitmap:
AK::deref_if_not_null(m_value.as_bitmap);
AK::unref_if_not_null(m_value.as_bitmap);
break;
case Type::Icon:
AK::deref_if_not_null(m_value.as_icon);
AK::unref_if_not_null(m_value.as_icon);
break;
default:
break;

View file

@ -48,7 +48,7 @@ public:
++m_ref_count;
}
void deref()
void unref()
{
ASSERT(m_ref_count);
if (!--m_ref_count) {
@ -60,7 +60,7 @@ public:
for (auto* child = m_first_child; child; child = next_child) {
next_child = child->m_next_sibling;
child->m_parent = nullptr;
child->deref();
child->unref();
}
delete static_cast<T*>(this);
}
@ -221,7 +221,7 @@ inline NonnullRefPtr<T> TreeNode<T>::remove_child(NonnullRefPtr<T> node, bool ca
if (call_removed_from)
node->removed_from(static_cast<T&>(*this));
node->deref();
node->unref();
return node;
}

View file

@ -81,11 +81,11 @@ private:
if (m_on_complete) {
CEventLoop::main().post_event(*this, make<CDeferredInvocationEvent>([this](CObject&) {
m_on_complete(m_result.release_value());
this->deref();
this->unref();
}));
CEventLoop::main().wake();
} else
this->deref();
this->unref();
});
}