mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
LibWeb: Don't take rendering task from queue while running rendering
If event loop is already executing rendering task, we should not start the next rendering task until the current one is finished. Fixes https://github.com/LadybirdBrowser/ladybird/issues/3717
This commit is contained in:
committed by
Alexander Kalenik
parent
b8af3fccf6
commit
4ca330adef
@@ -38,6 +38,8 @@ GC::Ptr<Task> TaskQueue::take_first_runnable()
|
||||
return nullptr;
|
||||
|
||||
for (size_t i = 0; i < m_tasks.size(); ++i) {
|
||||
if (m_event_loop->running_rendering_task() && m_tasks[i]->source() == Task::Source::Rendering)
|
||||
continue;
|
||||
if (m_tasks[i]->is_runnable())
|
||||
return m_tasks.take(i);
|
||||
}
|
||||
@@ -50,6 +52,8 @@ bool TaskQueue::has_runnable_tasks() const
|
||||
return false;
|
||||
|
||||
for (auto& task : m_tasks) {
|
||||
if (m_event_loop->running_rendering_task() && task->source() == Task::Source::Rendering)
|
||||
continue;
|
||||
if (task->is_runnable())
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user