From 5aa433cf1dc116326308e610dce80033aba67a85 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 2 Dec 2014 14:17:29 +0100 Subject: Flush UI message loop before quitting Cookies were not flushed on application exit because objects deleted lazy on the UI-thread never had their destructors called because we did not flush the queue on exit. Change-Id: If53cdb5547e15a9f39de8b99b1da313e307b1c90 Reviewed-by: Jocelyn Turcotte --- src/core/web_engine_context.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index ac9a921e7..db3956e5a 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -41,6 +41,7 @@ #include "base/base_switches.h" #include "base/command_line.h" #include "base/files/file_path.h" +#include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/threading/thread_restrictions.h" #include "cc/base/switches.h" @@ -93,6 +94,9 @@ void destroyContext() WebEngineContext::~WebEngineContext() { + base::MessagePump::Delegate *delegate = m_runLoop->loop_; + // Flush the UI message loop before quitting. + while (delegate->DoWork()) { } GLContextHelper::destroy(); m_runLoop->AfterRun(); } -- cgit v1.2.3