mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:07:46 +00:00
LibIPC: Do not leak the Core::File fd by default
This prevents fd leaks when the user of the API forgets to pass CloseAfterSending to IPC::File. Since we are calling leak_fd in the constructor, we want it to also take care of closing.
This commit is contained in:
parent
318a3a0822
commit
88872ca42d
3 changed files with 5 additions and 6 deletions
|
@ -40,9 +40,8 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
File(Core::File& file, Args... args)
|
||||
: File(file.leak_fd(Badge<File> {}), args...)
|
||||
explicit File(Core::File& file)
|
||||
: File(file.leak_fd(Badge<File> {}), CloseAfterSending)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue