mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:17:34 +00:00
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.
This commit is contained in:
parent
0ccef94a49
commit
220b7dd779
3 changed files with 26 additions and 14 deletions
|
@ -71,8 +71,8 @@ private:
|
|||
|
||||
KResult try_set_path(StringView);
|
||||
|
||||
// An open socket file on the filesystem.
|
||||
RefPtr<OpenFileDescription> m_file;
|
||||
// The inode this socket is bound to.
|
||||
WeakPtr<Inode> m_inode;
|
||||
|
||||
UserID m_prebind_uid { 0 };
|
||||
GroupID m_prebind_gid { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue