Skip to content

Truly independent web browser

LibWebView: Don't release a closed page when abandoning a history job

Andreas Klingb8aed97c1533
diff --git a/Libraries/LibWebView/CanonicalTraversable.cpp b/Libraries/LibWebView/CanonicalTraversable.cpp
index 9dcac8575bf..54f1117ab05 100644
--- a/Libraries/LibWebView/CanonicalTraversable.cpp
+++ b/Libraries/LibWebView/CanonicalTraversable.cpp
@@ -384,6 +384,10 @@ void CanonicalTraversable::stop_hosting_in_page(CanonicalNavigable& navigable, N
void CanonicalTraversable::release_page_if_unused(NonnullRefPtr<WebContentPage> page)
{
+ // A closed page has been let go of already, and the client of one whose process was lost can be gone, e.g. when
+ // recovering from the crash abandons a history job that populated a document in the page.
+ if (!page->is_open())
+ return;
if (page_hosts_any(page))
return;
// A page left hosting none of the tab's documents goes on representing the tab to a process holding part of