Skip to content

Commit 379956f

Browse files
charliewolfeJonWBedard
authored andcommitted
REGRESSION(283286.393@safari-7620-branch): Crash in PageOverlayController::uninstallPageOverlay
https://bugs.webkit.org/show_bug.cgi?id=283832 rdar://140529810 Reviewed by Chris Dumez. 283286.393@safari-7620-branch made the ResourceUsageOverlay destructor access the page it was holding instead of the page held by the page’s mainframe. This was a behavior change because the page destructor nulls the page held by the mainframe, so we would not try to uninstall the overlay if page destruction has begun. This change clears the page held by ResourceUsageOverlay in the page’s destructor to avoid uninstalling the overlay during page destruction. * Source/WebCore/page/Page.cpp: (WebCore::Page::~Page): * Source/WebCore/page/ResourceUsageOverlay.h: Originally-landed-as: 283286.535@safari-7620-branch (6bfd37a). rdar://144654097 Canonical link: https://commits.webkit.org/290254@main
1 parent f4ea5eb commit 379956f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Source/WebCore/page/Page.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ Page::~Page()
539539
if (RefPtr scrollingCoordinator = m_scrollingCoordinator)
540540
scrollingCoordinator->pageDestroyed();
541541

542+
if (m_resourceUsageOverlay)
543+
m_resourceUsageOverlay->detachFromPage();
544+
542545
checkedBackForward()->close();
543546
if (!isUtilityPage())
544547
BackForwardCache::singleton().removeAllItemsForPage(*this);

Source/WebCore/page/ResourceUsageOverlay.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class ResourceUsageOverlay final : public PageOverlayClient, public RefCounted<R
6363
void platformDraw(CGContextRef);
6464
#endif
6565

66+
void detachFromPage() { m_page.clear(); }
67+
6668
static const int normalWidth = 570;
6769
static const int normalHeight = 180;
6870

0 commit comments

Comments
 (0)