From bba90c3ea7c5aa5815fac271718191677a2da727 Mon Sep 17 00:00:00 2001
From: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Date: Tue, 1 Sep 2015 10:51:38 +0200
Subject: [PATCH] fix crash on exit when using the inspector

Destroy the DevToolsHttpHandler early on, because ~DevToolsHttpHandler
assumes the browser's UI thread is still running.
This fixes a crash on exit in tst_inspectorserver.

Change-Id: I98476231b709d60c249e58e17b09de70aed6792b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
---
 src/core/web_engine_context.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 727cfb491..4e4159cef 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -153,6 +153,7 @@ void WebEngineContext::destroy()
     // Flush the UI message loop before quitting.
     while (delegate->DoWork()) { }
     GLContextHelper::destroy();
+    m_devtools.reset(0);
     m_runLoop->AfterRun();
 
     // Force to destroy RenderProcessHostImpl by destroying BrowserMainRunner.
-- 
GitLab