1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:47:44 +00:00

LibThreading: Register BackgroundAction with EventLoop

BackgroundActions are now added as a job to the event loop, therefore
they get canceled when the loop exits and their on_complete action never
runs. This fixes all UAF bugs related to BackgroundAction's use of
EventLoops, as seen with e.g. thumbnail generation.
This commit is contained in:
kleines Filmröllchen 2022-12-29 14:57:00 +01:00 committed by Linus Groh
parent 8f4d0d3797
commit cf1fa419ab
4 changed files with 72 additions and 39 deletions

View file

@ -135,7 +135,7 @@ void FileProvider::query(DeprecatedString const& query, Function<void(Vector<Non
Vector<NonnullRefPtr<Result>> results;
for (auto& path : m_full_path_cache) {
if (task.is_cancelled())
if (task.is_canceled())
return {};
auto match_result = fuzzy_match(query, path);