From b974438cfcd015fe8c02bca0ece9f6279c608368 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 11 Oct 2024 14:04:42 -0400 Subject: [PATCH] Fix DiscardableSharedMemoryManager destruction timing Move DiscardableSharedMemoryManager destruction to the end of UI thread shutdown, after Mojo messages have stopped arriving. See related comments at https://chromium-review.googlesource.com/c/chromium/src/+/5925441 --- libcef/browser/main_runner.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libcef/browser/main_runner.cc b/libcef/browser/main_runner.cc index 9acb22ee6..dd671972e 100644 --- a/libcef/browser/main_runner.cc +++ b/libcef/browser/main_runner.cc @@ -449,9 +449,6 @@ void CefMainRunner::StartShutdownOnUIThread( content::BrowserTaskExecutor::RunAllPendingTasksOnThreadForTesting( content::BrowserThread::IO); - static_cast(main_runner_.get()) - ->ShutdownOnUIThread(); - std::move(shutdown_on_ui_thread).Run(); BeforeUIThreadShutdown(); } @@ -462,6 +459,9 @@ void CefMainRunner::FinishShutdownOnUIThread() { // It is safe to call multiple times. ChromeProcessSingleton::DeleteInstance(); } + + static_cast(main_runner_.get()) + ->ShutdownOnUIThread(); } void CefMainRunner::BeforeUIThreadInitialize() {