Skip to content

Truly independent web browser

LibWeb: Root the discarded tasks of a TaskQueue

Shannon Boothe219934d9462
diff --git a/Libraries/LibWeb/HTML/EventLoop/TaskQueue.cpp b/Libraries/LibWeb/HTML/EventLoop/TaskQueue.cpp
index d2ae1cab5f5..1d52ade6741 100644
--- a/Libraries/LibWeb/HTML/EventLoop/TaskQueue.cpp
+++ b/Libraries/LibWeb/HTML/EventLoop/TaskQueue.cpp
@@ -170,7 +170,7 @@ void TaskQueue::remove_without_running(Task::Queue& tasks, Task& task)
void TaskQueue::run_discard_steps()
{
while (!m_discarded_tasks.is_empty()) {
- auto discarded_tasks = move(m_discarded_tasks);
+ GC::RootVector discarded_tasks { move(m_discarded_tasks) };
for (auto& task : discarded_tasks)
task->discard();
}