The problem is that I cannot properly close the application. On exit, I have what looks like a thread deadlock:
- Code: Select all
> libcef.dll!base::WaitableEvent::Wait() Line 49 C++
libcef.dll!mojo::common::WatcherThreadManager::StopWatching(int watcher_id) Line 272 C++
libcef.dll!mojo::common::HandleWatcher::SecondaryThreadWatchingState::`scalar deleting destructor'() + 0x21 bytes C++
libcef.dll!mojo::common::HandleWatcher::~HandleWatcher() Line 453 + 0xd bytes C++
libcef.dll!mojo::internal::`anonymous namespace'::CancelWait(unsigned int wait_id) Line 35 + 0xe bytes C++
libcef.dll!mojo::internal::Connector::~Connector() Line 35 + 0x10 bytes C++
libcef.dll!mojo::internal::Router::~Router() Line 74 + 0x36 bytes C++
libcef.dll!mojo::internal::Router::`scalar deleting destructor'() + 0xb bytes C++
libcef.dll!content::ServiceRegistryImpl::~ServiceRegistryImpl() Line 20 + 0x92 bytes C++
libcef.dll!content::ServiceRegistryImpl::`scalar deleting destructor'() + 0xb bytes C++
libcef.dll!content::RenderFrameHostImpl::~RenderFrameHostImpl() Line 218 + 0x65 bytes C++
libcef.dll!content::RenderFrameHostImpl::`scalar deleting destructor'() + 0xb bytes C++
libcef.dll!content::RenderFrameHostManager::~RenderFrameHostManager() Line 96 C++
libcef.dll!content::FrameTreeNode::~FrameTreeNode() Line 73 + 0x34 bytes C++
libcef.dll!content::FrameTree::~FrameTree() Line 71 + 0x16 bytes C++
libcef.dll!content::WebContentsImpl::~WebContentsImpl() Line 487 + 0x2a6 bytes C++
libcef.dll!content::WebContentsImpl::`scalar deleting destructor'() + 0xb bytes C++
libcef.dll!CefBrowserHostImpl::DestroyBrowser() Line 1443 + 0x1a bytes C++
libcef.dll!CefContentBrowserClient::DestroyAllBrowsers() Line 507 C++
libcef.dll!CefContext::FinishShutdownOnUIThread(base::WaitableEvent * uithread_shutdown_event) Line 376 C++
libcef.dll!CefContext::Shutdown() Line 316 C++
libcef.dll!CefShutdown() Line 144 C++
My application is constructed such that I have a main message loop, and I call CefDoMessageLoopWork() within it. I have a main window, and on its WM_DESTROY, I call PostQuitMessage(). When the message loop exits, I call CefShutdown(), and this is where it hangs.
As I mentioned, this flow worked perfectly in an earlier branch, so I am not sure if there is a flaw in my logic, or if it's not working because of a structural change I'm not aware of, or if there's a bug somewhere.
I am handling the ::OnBeforeClose() for my CefLifeSpanHandler and setting the browser instance to null, and I have no other non-null references to the CefBrowser at this point.
Any ideas about what could be causing this or how to get around this problem?
Thanks!
-Jason-