summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Christiansen <tobyase@serenityos.org>2021-09-04 14:13:52 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-04 16:07:10 +0200
commit5d732711a210584d5e0c63b7a99b5a9d8b17aede (patch)
treea98131cb14570560ddecb57bc0d586c411115be3
parent9699648b2a5f86a338564b303c8ec960e98842f7 (diff)
downloadserenity-5d732711a210584d5e0c63b7a99b5a9d8b17aede.zip
PixelPaint: Fix broken opening of files from Shell
The fd would get closed when the File went out of scope, so we couldn't open any file specified by 'pp <path to file>'. We need the fd to be alive and we solemnly swear to take good care of it and close it ourselves later.
-rw-r--r--Userland/Applications/PixelPaint/ProjectLoader.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Applications/PixelPaint/ProjectLoader.cpp b/Userland/Applications/PixelPaint/ProjectLoader.cpp
index 0dfab4bdbf..66303827ac 100644
--- a/Userland/Applications/PixelPaint/ProjectLoader.cpp
+++ b/Userland/Applications/PixelPaint/ProjectLoader.cpp
@@ -69,7 +69,7 @@ Result<void, String> ProjectLoader::try_load_from_path(StringView path)
if (file_or_error.is_error())
return String::formatted("Unable to open file because: {}", file_or_error.release_error());
- return try_load_from_fd_and_close(file_or_error.release_value()->fd(), path);
+ return try_load_from_fd_and_close(file_or_error.release_value()->leak_fd(), path);
}
}