Skip to content

Truly independent web browser

LibWeb: Root the spell checking settled callbacks while running them

Shannon Boothf3081be7fe00
diff --git a/Libraries/LibWeb/Page/Page.cpp b/Libraries/LibWeb/Page/Page.cpp
index 059ed4e8ab2..04c32ad3fa3 100644
--- a/Libraries/LibWeb/Page/Page.cpp
+++ b/Libraries/LibWeb/Page/Page.cpp
@@ -1413,7 +1413,8 @@ void Page::notify_spell_check_progress()
{
if (m_spell_checking_settled_callbacks.is_empty() || !spell_checking_is_settled(*this))
return;
- for (auto& callback : exchange(m_spell_checking_settled_callbacks, {}))
+ GC::RootVector callbacks { exchange(m_spell_checking_settled_callbacks, {}) };
+ for (auto& callback : callbacks)
callback->function()();
}