This is CEF 3.2924.1575.g97389a9 and Windows 32-bit, with CEF's browser hosted inside a parent mainframe. settings.multi_threaded_message_loop = true and the main message loop is a stock loop in _tWinMain not a CEF object.
Normal behavior
- Code: Select all
18:42:42.563 - Calling CloseAllBrowsers
18:42:42.566 - Pump messages
18:42:42.568 - ClientHandler::DoClose id=1
18:42:42.573 - ClientHandler::OnBeforeClose - browser count 0
18:42:42.642 - Destroying mainframe
18:42:42.646 - WM_DESTROY = 3016120 -- mainframe, does PostQuitMessage(0);
18:42:42.651 - Ending process, CefShutdown()
18:42:42.663 - Ending process, CefShutdown() complete
18:42:42.668 - ExitInstance
18:42:42.672 - ExitInstance complete
Hang behavior
- Code: Select all
10:39:36.583 - Calling CloseAllBrowsers
10:39:36.586 - Pump messages
10:39:36.592 - ClientHandler::DoClose id=2
10:39:36.628 - ClientHandler::DoClose id=1
10:39:36.633 - ClientHandler::OnBeforeClose - browser count 0
10:39:36.728 - Destroying mainframe
10:39:36.736 - WM_DESTROY = 329490 -- mainframe, does PostQuitMessage(0);
** does not continue on to _tWinMain code, does not call CefShutdown() **
[External Code]
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
> libcef.dll!base::MessagePumpForUI::WaitForWork() Line 212 C++
libcef.dll!base::MessagePumpForUI::DoRunLoop() Line 199 C++
libcef.dll!base::MessagePumpWin::Run(base::MessagePump::Delegate * delegate) Line 58 C++
libcef.dll!base::MessageLoop::RunHandler() Line 376 C++
libcef.dll!base::RunLoop::Run() Line 36 C++
libcef.dll!base::Thread::Run(base::RunLoop * run_loop) Line 246 C++
libcef.dll!content::BrowserThreadImpl::FileThreadRun(base::RunLoop * run_loop) Line 228 C++
libcef.dll!content::BrowserThreadImpl::Run(base::RunLoop * run_loop) Line 280 C++
libcef.dll!base::Thread::ThreadMain() Line 336 C++
libcef.dll!base::`anonymous namespace'::ThreadFunc(void * params) Line 86 C++
[External Code]
WaitForWork() is sitting with delay = INFINITE; and wait_flags = MWMO_INPUTAVAILABLE; at the MsgWaitForMultipleObjectsEx() call.
I'm guessing I could fix that if I could figure out how to send it a WM_QUIT to this specific handler, but normally that is not needed.
To make things harder, our code doesn't match the current CefClient sample since it was written based on CEF 2272 and only updated as needed for changed -Handler event signatures.
Any suggestions are welcome.