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
  • Loading branch information
cdumez authored and aperezdc committed Feb 16, 2024
1 parent 2ff1b38 commit 22216da
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 @@ -1817,7 +1817,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 22216da

Please sign in to comment.