Commit 5aa433cf authored by Allan Sandfeld Jensen's avatar Allan Sandfeld Jensen Committed by Allan Sandfeld Jensen
Browse files

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: default avatarJocelyn Turcotte <jocelyn.turcotte@digia.com>
Showing with 4 additions and 0 deletions
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "base/base_switches.h" #include "base/base_switches.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "cc/base/switches.h" #include "cc/base/switches.h"
...@@ -93,6 +94,9 @@ void destroyContext() ...@@ -93,6 +94,9 @@ void destroyContext()
WebEngineContext::~WebEngineContext() WebEngineContext::~WebEngineContext()
{ {
base::MessagePump::Delegate *delegate = m_runLoop->loop_;
// Flush the UI message loop before quitting.
while (delegate->DoWork()) { }
GLContextHelper::destroy(); GLContextHelper::destroy();
m_runLoop->AfterRun(); m_runLoop->AfterRun();
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment