Skip to content

Commit

Permalink
[Debug] Referencing m_processPool in ~WebProcessProxy() causes a …
Browse files Browse the repository at this point in the history
…crash

https://bugs.webkit.org/show_bug.cgi?id=264178

Reviewed by Chris Dumez.

Cached `WebProcess`es can be destroyed as a result of clearing
`WebProcessPool`'s cache during its destruction.

In this case, referencing `m_processPool` will fail because its deletion
has already begun.

* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy):

Canonical link: https://commits.webkit.org/270209@main
  • Loading branch information
obyknovenius authored and cdumez committed Nov 3, 2023
1 parent aa06a71 commit 0015b17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/WebKit/UIProcess/WebProcessProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ WebProcessProxy::~WebProcessProxy()
WebPasteboardProxy::singleton().removeWebProcessProxy(*this);

#if HAVE(DISPLAY_LINK)
// Prewarmed / cached processes may not have a process pool on destruction.
if (RefPtr processPool = m_processPool.get())
// Unable to ref the process pool as it may have started destruction.
if (auto* processPool = m_processPool.get())
processPool->displayLinks().stopDisplayLinks(m_displayLinkClient);
#endif

Expand Down

0 comments on commit 0015b17

Please sign in to comment.