mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-01-28 10:09:25 +01:00
Fix race with multi-threaded message loop (fixes issue #2668).
Remove the local thread object in favor of setting the ui_thread_ field directly. This avoids the race between ui_thread_.swap(thread) and CefUIThread::InitializeBrowserRunner.
This commit is contained in:
parent
17ec55a3b3
commit
1086495096
@ -723,11 +723,9 @@ int CefMainDelegate::RunProcess(
|
|||||||
bool CefMainDelegate::CreateUIThread(base::OnceClosure setup_callback) {
|
bool CefMainDelegate::CreateUIThread(base::OnceClosure setup_callback) {
|
||||||
DCHECK(!ui_thread_);
|
DCHECK(!ui_thread_);
|
||||||
|
|
||||||
std::unique_ptr<CefUIThread> thread;
|
ui_thread_.reset(new CefUIThread(std::move(setup_callback)));
|
||||||
thread.reset(new CefUIThread(std::move(setup_callback)));
|
ui_thread_->Start();
|
||||||
thread->Start();
|
ui_thread_->WaitUntilThreadStarted();
|
||||||
thread->WaitUntilThreadStarted();
|
|
||||||
ui_thread_.swap(thread);
|
|
||||||
|
|
||||||
InitMessagePumpFactoryForUI();
|
InitMessagePumpFactoryForUI();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user