diff options
-rw-r--r-- | Kernel/FileSystem/File.cpp | 9 | ||||
-rw-r--r-- | Kernel/FileSystem/File.h | 3 | ||||
-rw-r--r-- | Kernel/TTY/SlavePTY.h | 2 |
3 files changed, 2 insertions, 12 deletions
diff --git a/Kernel/FileSystem/File.cpp b/Kernel/FileSystem/File.cpp index 612ad2ffce..5b44450ce0 100644 --- a/Kernel/FileSystem/File.cpp +++ b/Kernel/FileSystem/File.cpp @@ -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); diff --git a/Kernel/FileSystem/File.h b/Kernel/FileSystem/File.h index 6c2c9388cb..b4f4124a8a 100644 --- a/Kernel/FileSystem/File.h +++ b/Kernel/FileSystem/File.h @@ -71,10 +71,9 @@ public: // - Should create a Region in the Process and return it if successful. class File - : public RefCountedBase + : public RefCounted<File> , public Weakable<File> { public: - virtual bool unref() const; virtual void will_be_destroyed() { } virtual ~File(); diff --git a/Kernel/TTY/SlavePTY.h b/Kernel/TTY/SlavePTY.h index 4be7373e77..190408703f 100644 --- a/Kernel/TTY/SlavePTY.h +++ b/Kernel/TTY/SlavePTY.h @@ -15,7 +15,7 @@ class MasterPTY; class SlavePTY final : public TTY { public: - virtual bool unref() const override; + bool unref() const; virtual ~SlavePTY() override; void on_master_write(const UserOrKernelBuffer&, size_t); |