Skip to content

Commit

Permalink
Cherry-pick 274641@main (c3b754f). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=269373

    Crash under WebPage::close()
    https://bugs.webkit.org/show_bug.cgi?id=269373
    rdar://118486861

    Reviewed by Brent Fulgham.

    Add a null check for the LocalFrame given that nothing prevents it
    from being null and we're seeing null dereferences in the wild.

    * Source/WebKit/WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::close):

    Canonical link: https://commits.webkit.org/274641@main

Canonical link: https://commits.webkit.org/266719.373@webkitglib/2.42
  • Loading branch information
cdumez authored and aperezdc committed Mar 14, 2024
1 parent 724a0de commit 18e8f9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/WebKit/WebProcess/WebPage/WebPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,8 @@ void WebPage::close()
#endif

m_printContext = nullptr;
m_mainFrame->coreLocalFrame()->loader().detachFromParent();
if (RefPtr localFrame = m_mainFrame->coreLocalFrame())
localFrame->loader().detachFromParent();

#if ENABLE(SCROLLING_THREAD)
if (m_useAsyncScrolling)
Expand Down

0 comments on commit 18e8f9b

Please sign in to comment.