1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:38:12 +00:00

Kernel: Rename File::{before_removing => will_be_destroyed}

This will allow File and it's descendants to use RefCounted instead of
having a custom implementation of unref. (Since RefCounted calls
will_be_destroyed automatically)

This commit also removes an erroneous call to `before_removing` in
AHCIPort, this is a duplicate call, as the only reference to the device
is immediately dropped following the call, which in turns calls
`before_removing` via File::unref.
This commit is contained in:
Idan Horowitz 2021-12-29 01:00:29 +02:00 committed by Andreas Kling
parent d7ec5d042f
commit 4a3a947df3
6 changed files with 5 additions and 6 deletions

View file

@ -24,7 +24,7 @@ bool File::unref() const
{
if (deref_base())
return false;
const_cast<File&>(*this).before_removing();
const_cast<File&>(*this).will_be_destroyed();
delete this;
return true;
}