mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +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:
committed by
Tim Schumacher
parent
5b2496e522
commit
062e0db46c
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user