summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2019-02-28 13:21:48 +0100
committerMichal Klocek <michal.klocek@qt.io>2019-03-01 10:04:44 +0000
commitddfa2997939fc4de2993b3e0de2201eca534af61 (patch)
tree7f35c063e386e674603c252acaede5c58fd36043
parent8600d3d22d86be364a4c29e559dda7990594d0c5 (diff)
Fix destruction of qt quick profile after WebEngineContext gets deleted
Issue takes place when QQmlApplicationEngine is a child of qApp. In case WebEngineContext gets destructed do not try to get default profile, which is anyway already gone. Task-number: QTBUG-74116 Change-Id: I24ea87baf677360a420d444b4c964feb722ab317 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/core/profile_adapter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index 462be9f48..50a97a6ac 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -200,7 +200,8 @@ ProfileAdapter *ProfileAdapter::createDefaultProfileAdapter()
ProfileAdapter *ProfileAdapter::defaultProfileAdapter()
{
- return WebEngineContext::current()->defaultProfileAdapter();
+ WebEngineContext *context = WebEngineContext::current();
+ return context ? context->defaultProfileAdapter() : nullptr;
}
QObject* ProfileAdapter::globalQObjectRoot()