summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-12-02 14:17:29 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2014-12-02 15:07:55 +0100
commit5aa433cf1dc116326308e610dce80033aba67a85 (patch)
tree27ace64cbee32df9af7e104214ec7e83d4553c01
parent03a52863226aeb774721db610ba831808b30836a (diff)
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 <jocelyn.turcotte@digia.com>
-rw-r--r--src/core/web_engine_context.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index ac9a921e..db3956e5 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();
}