Skip to content

Commit

Permalink
[UnifedPDF] Occasional crash at GraphicsLayerCA::setNeedsDisplayInRec…
Browse files Browse the repository at this point in the history
…t() with slow-rendering PDFs

https://bugs.webkit.org/show_bug.cgi?id=273661
rdar://127443945

Reviewed by Abrar Rahman Protyasha.

We should use `unparentAndClear()` on the GraphicsLayers to both unparent them, and clear their
GraphicsLayerClient. Do this on the layers which draw content, since those are the ones whose
clients can get called after a delay.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::teardown):

Canonical link: https://commits.webkit.org/278298@main
  • Loading branch information
smfr committed May 3, 2024
1 parent e7ab50a commit 593a442
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ static String mutationObserverNotificationString()

PDFPluginBase::teardown();

if (m_rootLayer)
m_rootLayer->removeFromParent();
GraphicsLayer::unparentAndClear(m_rootLayer);
GraphicsLayer::unparentAndClear(m_contentsLayer);
#if ENABLE(UNIFIED_PDF_SELECTION_LAYER)
GraphicsLayer::unparentAndClear(m_selectionLayer);
#endif

RefPtr page = this->page();
if (m_scrollingNodeID && page) {
Expand Down

0 comments on commit 593a442

Please sign in to comment.