With multi_threaded_message_loop = true, what is proper way to destroy browser window?
My Windows MDI app opens several browsers and everything works fine until I open and close browsers quickly, then the app crashes somewhere deep in libcef.dll. Looks as I'm not closing the window properly and CEF is trying to access some deleted object. I do it in the way copied from some example:
auto hBrowser = m_cefBrowser->GetHost()->GetWindowHandle();
::DestroyWindow(hBrowser);
Is there anything I should do differently in multi_threaded_message_loop mode?
The stack:
> libcef.dll!`anonymous namespace'::PureCall() Line 21 C++
libcef.dll!_purecall() Line 29 C++
libcef.dll!content::RenderFrameHostImpl::OnUpdateTitle(const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > & title={...}, blink::WebTextDirection title_direction=WebTextDirectionLeftToRight) Line 1684 + 0x24 bytes C++
libcef.dll!IPC::MessageT<FrameHostMsg_UpdateTitle_Meta,std::tuple<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >,enum blink::WebTextDirection>,void>::Dispatch<content::RenderFrameHostImpl,content::RenderFrameHostImpl,void,void (__thiscall content::RenderFrameHostImpl::*)(std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > const &,enum blink::WebTextDirection)>(const IPC::Message * msg=0x071e4738, content::RenderFrameHostImpl * obj=0x073baad0, content::RenderFrameHostImpl * sender=0x073baad0, void * parameter=0x00000000, void (const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > &, blink::WebTextDirection)* func=0x1180f06c) Line 121 + 0x10 bytes C++
libcef.dll!content::RenderFrameHostImpl::OnMessageReceived(const IPC::Message & msg={...}) Line 592 + 0x38 bytes C++
libcef.dll!content::RenderProcessHostImpl::OnMessageReceived(const IPC::Message & msg={...}) Line 1774 + 0x5 bytes C++
libcef.dll!IPC::ChannelProxy::Context::OnDispatchMessage(const IPC::Message & message={...}) Line 285 C++
libcef.dll!base::internal::Invoker<base::internal::BindState<base::internal::RunnableAdapter<void (__thiscall content::InputEventFilter::*)(IPC::Message const &)>,content::InputEventFilter * const,IPC::Message const &>,void __cdecl(void)>::Run(base::internal::BindStateBase * base=0x071e4728) Line 346 C++
libcef.dll!base::debug::TaskAnnotator::RunTask(const char * queue_function=0x12effd1c, const base::PendingTask & pending_task={...}) Line 51 + 0x5 bytes C++
libcef.dll!base::MessageLoop::RunTask(const base::PendingTask & pending_task={...}) Line 491 C++
libcef.dll!base::MessageLoop::DoWork() Line 622 C++
libcef.dll!base::MessagePumpForUI::DoRunLoop() Line 263 C++
libcef.dll!base::MessagePumpWin::Run(base::MessagePump::Delegate * delegate=0x06f47db8) Line 142 C++
libcef.dll!base::RunLoop::Run() Line 36 C++
libcef.dll!base::Thread::Run(base::MessageLoop * message_loop=0x06f47db8) Line 205 + 0xf bytes C++
libcef.dll!base::Thread::ThreadMain() Line 259 C++
libcef.dll!base::`anonymous namespace'::ThreadFunc(void * params=0x06f24168) Line 85 C++