mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:54:58 +00:00
LibCore: Make MappedFile OwnPtr-based
Since it will become a stream in a little bit, it should behave like all non-trivial stream classes, who are not primarily intended to have shared ownership to make closing behavior more predictable. Across all uses of MappedFile, there is only one use case of shared mapped files in LibVideo, which now uses the thin SharedMappedFile wrapper.
This commit is contained in:
parent
5b2496e522
commit
062e0db46c
32 changed files with 80 additions and 64 deletions
|
@ -116,7 +116,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
Optional<ReadonlyBytes> icc_data = TRY(decoder->icc_data());
|
||||
|
||||
RefPtr<Core::MappedFile> icc_file;
|
||||
OwnPtr<Core::MappedFile> icc_file;
|
||||
if (!assign_color_profile_path.is_empty()) {
|
||||
icc_file = TRY(Core::MappedFile::map(assign_color_profile_path));
|
||||
icc_data = icc_file->bytes();
|
||||
|
@ -128,7 +128,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
return 1;
|
||||
}
|
||||
|
||||
auto source_icc_file = icc_file;
|
||||
auto source_icc_file = move(icc_file);
|
||||
auto source_icc_data = icc_data.value();
|
||||
icc_file = TRY(Core::MappedFile::map(convert_color_profile_path));
|
||||
icc_data = icc_file->bytes();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue