Skip to content

Commit fa8b64c

Browse files
authored
Merge pull request #1386 from WebPlatformForEmbedded/pgorszkowski/2.38/do_not_dispatch_responsiveness_handler_in_the_middle_of_destruction
Do not dispatch responsiveness handler in the middle of destruction o…
2 parents 63a4db7 + 9d710de commit fa8b64c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,9 @@ void AuxiliaryProcessProxy::checkForResponsiveness(CompletionHandler<void()>&& r
423423
{
424424
startResponsivenessTimer(useLazyStop);
425425
sendWithAsyncReply(Messages::AuxiliaryProcess::MainThreadPing(), [weakThis = WeakPtr { *this }, responsivenessHandler = WTFMove(responsivenessHandler)]() mutable {
426+
if (!weakThis || !weakThis->hasConnection() || !weakThis->connection()->isValid())
427+
return;
428+
426429
// Schedule an asynchronous task because our completion handler may have been called as a result of the AuxiliaryProcessProxy
427430
// being in the middle of destruction.
428431
RunLoop::main().dispatch([weakThis = WTFMove(weakThis), responsivenessHandler = WTFMove(responsivenessHandler)]() mutable {

0 commit comments

Comments
 (0)