I have CEF in our app where we have some dialogs hosting web pages. I have been seeing a random crash during shutdown even though I have scoured the code to make sure I set the cef app pointer to nullptr and the browser pointers to nullptr when closing down. Let me note that I am running my Visual Studio 2019 app in debug but I only link to the release cef lib file and use the release DLLs. Every time I have crashed, the stack shows an audio stream being stopped. I have a stack below and the crash occurs after I set my cef app pointer to nullptr and call CefShutdown. Stepping into the source, it is the actual call to the cef DLL shutdown api that results in the crash. Very hard to reproduce with my app and appears to be related to stuff running in a worker thread. I suspect I am just not closing down correctly. My sequence is the destroy my windows hosting the browser at which time I call the GetHost()->CloseBrowser(true) and then GetHost()->GetWindowHandle() and pass that to the Windows DestroyWindow api. Finally, I set the browser to nullptr. Perhaps the order is wrong?
libcef.dll!logging::LogMessage::~LogMessage() Line 953 C++
libcef.dll!cef_log(const char * file, int line, int severity, const char * message) Line 335 C++
jengined.dll!cef::logging::LogMessage::~LogMessage() Line 186 C++
> jengined.dll!shutdown_checker::AssertNotShutdown() Line 54 C++
jengined.dll!`anonymous namespace'::life_span_handler_on_before_close(_cef_life_span_handler_t * self, _cef_browser_t * browser) Line 198 C++
libcef.dll!CefAudioHandlerCToCpp::OnAudioStreamStopped(scoped_refptr<CefBrowser> browser) Line 113 C++
libcef.dll!CefBrowserHostImpl::DestroyBrowser() Line 1537 C++
libcef.dll!CefBrowserInfoManager::DestroyAllBrowsers() Line 352 C++
libcef.dll!CefContext::FinishShutdownOnUIThread(base::WaitableEvent * uithread_shutdown_event) Line 680 C++
[Inline Frame] libcef.dll!base::OnceCallback<void ()>::Run() Line 98 C++
libcef.dll!base::TaskAnnotator::RunTask(const char * trace_event_name, base::PendingTask * pending_task) Line 142 C++
libcef.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::sequence_manager::LazyNow * continuation_lazy_now, bool * ran_task) Line 325 C++
libcef.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() Line 250 C++
libcef.dll!base::MessagePumpForUI::DoRunLoop() Line 219 C++
libcef.dll!base::MessagePumpWin::Run(base::MessagePump::Delegate * delegate) Line 77 C++