Ok, but I'm not doing anything with the client manager yet, the only calls to it are coming internally from CEF so surely it would call itself on the appropriate thread already. If I create it where I do in WinMain it is being instantiated on the main browser thread, as all sub-processes terminate at the CefExecuteProcess(..)
It's odd that it works in release mode ?
It seems like the following is the issue: the main application starts on thread x ... the sub processes are spawned, the CEF message loop starts up on thread x2.
When the message loop sends out the events for OnAfterCreated, those methods are being called on the message loops thread, and not the main thread, but I don't have any control over CEFs internal message loop ?
All of this occurs before I have a chance to do anything, post any messages etc.
Trace:
- Code: Select all
libcef.dll!base::debug::BreakDebugger() Line 21 C++
libcef.dll!logging::LogMessage::~LogMessage() Line 855 C++
libcef.dll!cef_log(const char * file, int line, int severity, const char * message) Line 336 C++
PlayTableHub.exe!cef::logging::LogMessage::~LogMessage() Line 187 C++
PlayTableHub.exe!shared::ClientManager::OnAfterCreated(scoped_refptr<CefBrowser> browser) Line 37 C++ <<<< CHECK FAILS HERE
> PlayTableHub.exe!shared::OnAfterCreated(scoped_refptr<CefBrowser> browser) Line 41 C++
PlayTableHub.exe!resource_manager::Client::OnAfterCreated(scoped_refptr<CefBrowser> browser) Line 94 C++
PlayTableHub.exe!`anonymous namespace'::life_span_handler_on_after_created(_cef_life_span_handler_t * self, _cef_browser_t * browser) Line 138 C++
libcef.dll!CefLifeSpanHandlerCToCpp::OnAfterCreated(scoped_refptr<CefBrowser> browser) Line 100 C++
libcef.dll!CefBrowserHostImpl::CreateInternal(const CefStructBase<CefBrowserSettingsTraits> & settings, scoped_refptr<CefClient> client, content::WebContents * web_contents, bool own_web_contents, scoped_refptr<CefBrowserInfo> browser_info, scoped_refptr<CefBrowserHostImpl> opener, bool is_devtools_popup, scoped_refptr<CefRequestContext> request_context, std::unique_ptr<CefBrowserPlatformDelegate,std::default_delete<CefBrowserPlatformDelegate> > platform_delegate, scoped_refptr<CefExtension> extension) Line 433 C++
libcef.dll!CefBrowserHostImpl::Create(CefBrowserHostImpl::CreateParams & create_params) Line 359 C++
libcef.dll!CefBrowserHost::CreateBrowserSync(const CefWindowInfo & windowInfo, scoped_refptr<CefClient> client, const CefStringBase<CefStringTraitsUTF16> & url, const CefStructBase<CefBrowserSettingsTraits> & settings, scoped_refptr<CefRequestContext> request_context) Line 276 C++
libcef.dll!`anonymous namespace'::CreateBrowserWithHelper(`anonymous namespace'::CreateBrowserHelper * helper) Line 142 C++
libcef.dll!base::debug::TaskAnnotator::RunTask(const char * queue_function, base::PendingTask * pending_task) Line 101 C++
libcef.dll!base::internal::IncomingTaskQueue::RunTask(base::PendingTask * pending_task) Line 124 C++
libcef.dll!base::MessageLoop::RunTask(base::PendingTask * pending_task) Line 320 C++
libcef.dll!base::MessageLoop::DeferOrRunPendingTask(base::PendingTask pending_task) Line 329 C++
libcef.dll!base::MessageLoop::DoWork() Line 373 C++
libcef.dll!base::MessagePumpForUI::DoRunLoop() Line 179 C++
libcef.dll!base::MessagePumpWin::Run(base::MessagePump::Delegate * delegate) Line 59 C++
libcef.dll!base::MessageLoop::Run(bool application_tasks_allowed) Line 273 C++
libcef.dll!base::RunLoop::Run() Line 105 C++
libcef.dll!base::Thread::Run(base::RunLoop * run_loop) Line 255 C++
libcef.dll!base::Thread::ThreadMain() Line 340 C++
libcef.dll!base::`anonymous namespace'::ThreadFunc(void * params) Line 94 C++
kernel32.dll!BaseThreadInitThunk() Unknown
ntdll.dll!RtlUserThreadStart() Unknown