summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
diff options
context:
space:
mode:
authorsin-ack <sin-ack@users.noreply.github.com>2021-09-16 00:10:03 +0000
committerAndreas Kling <kling@serenityos.org>2021-09-16 16:50:36 +0200
commit220b7dd77905b7d573ded093cf88d2dc51f57c69 (patch)
tree35ff8b15abeab295dc2b22cdf198332c14191bbe /Kernel/FileSystem
parent0ccef94a496300becc4dd6e5a2bde3c7fe12dc68 (diff)
downloadserenity-220b7dd77905b7d573ded093cf88d2dc51f57c69.zip
Kernel: Weakly hold on to the file in LocalSocket
Because we were holding a strong ref to the OpenFileDescription in LocalSocket and a strong ref to the LocalSocket in Inode, we were creating a reference cycle in the event of the socket being cleaned up after the file description did (i.e. unlinking the file before closing the socket), because the file description never got destructed.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r--Kernel/FileSystem/Inode.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/FileSystem/Inode.h b/Kernel/FileSystem/Inode.h
index c078d83608..971a2f57ac 100644
--- a/Kernel/FileSystem/Inode.h
+++ b/Kernel/FileSystem/Inode.h
@@ -23,7 +23,8 @@
namespace Kernel {
-class Inode : public ListedRefCounted<Inode> {
+class Inode : public ListedRefCounted<Inode>
+ , public Weakable<Inode> {
friend class VirtualFileSystem;
friend class FileSystem;