mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +00:00
Kernel: Port File to RefCounted
Since RefCounted automatically calls a method named `will_be_destoyed` on classes that have one, so there's no need to have a custom implementation of unref in File.
This commit is contained in:
committed by
Andreas Kling
parent
4a3a947df3
commit
6e2a82df13
@@ -20,15 +20,6 @@ File::~File()
|
||||
{
|
||||
}
|
||||
|
||||
bool File::unref() const
|
||||
{
|
||||
if (deref_base())
|
||||
return false;
|
||||
const_cast<File&>(*this).will_be_destroyed();
|
||||
delete this;
|
||||
return true;
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<OpenFileDescription>> File::open(int options)
|
||||
{
|
||||
auto description = OpenFileDescription::try_create(*this);
|
||||
|
||||
Reference in New Issue
Block a user