mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
CrashReporter: Dispatch backtrace progress callbacks on the main thread
We can't fiddle with GUI widgets off the main thread, so let's use Core::EventLoop::deferred_invoke() to dispatch the work. The progress bar doesn't visibly update yet, but at least we're not crashing anymore.
This commit is contained in:
parent
d1cea57246
commit
58b5aede65
Notes:
sideshowbarker
2024-07-17 20:16:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/58b5aede655
1 changed files with 7 additions and 4 deletions
|
@ -297,10 +297,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
size_t thread_index = 0;
|
||||
coredump->for_each_thread_info([&](auto& thread_info) {
|
||||
results.thread_backtraces.append(build_backtrace(*coredump, thread_info, thread_index, [&](size_t frame_index, size_t frame_count) {
|
||||
window->set_progress(100.0f * (float)(frame_index + 1) / (float)frame_count);
|
||||
progressbar.set_value(frame_index + 1);
|
||||
progressbar.set_max(frame_count);
|
||||
Core::EventLoop::wake();
|
||||
Core::EventLoop::with_main_locked([&](auto& main) {
|
||||
main->deferred_invoke([&] {
|
||||
window->set_progress(100.0f * (float)(frame_index + 1) / (float)frame_count);
|
||||
progressbar.set_value(frame_index + 1);
|
||||
progressbar.set_max(frame_count);
|
||||
});
|
||||
});
|
||||
}));
|
||||
results.thread_cpu_registers.append(build_cpu_registers(thread_info, thread_index));
|
||||
++thread_index;
|
||||
|
|
Loading…
Add table
Reference in a new issue