mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +00:00
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.
This commit is contained in:
parent
9699648b2a
commit
5d732711a2
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue