summaryrefslogtreecommitdiffstats
path: root/src/core/aspects/qabstractaspect.cpp
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2016-06-27 10:53:46 +0100
committerSean Harmer <sean.harmer@kdab.com>2016-07-01 11:00:38 +0000
commitb656d9c426fb36220538d656b99d01f1ea161824 (patch)
treef1d845e8e82959c03c0c159c203110e74a8bdae1 /src/core/aspects/qabstractaspect.cpp
parent96a11061fbfd31a811fa74eb3c6c8fd86221af70 (diff)
Do not create OpenGL context until render aspect is registered
This avoids a race where the renderer creates a context based on the default format when the render aspect is created. The alternative fix would have been to simply create the QRenderAspect after setting the default surface format. However, that would mean being careful to do that everywhere in the future too. This fixes it more neatly and completely by creating the renderer in the render aspect's onRegistered() function. Whilst in there, this also solves the previous asymmetry in the onRegistered() and onUnregistred() functions. We now also unregister backend types and re-register them in onRegistered. This is necessary because the mappers depend upon the renderer. Also added a todo to make the unregisterBackendType() functions public for 5.8. Task-number: QTBUG-54370 Task-number: QTBUG-53880 Change-Id: I09a774739df069d3210ed0efe6dd504d968b05f3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/core/aspects/qabstractaspect.cpp')
-rw-r--r--src/core/aspects/qabstractaspect.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/aspects/qabstractaspect.cpp b/src/core/aspects/qabstractaspect.cpp
index fbdaf30da..86435b4e5 100644
--- a/src/core/aspects/qabstractaspect.cpp
+++ b/src/core/aspects/qabstractaspect.cpp
@@ -79,6 +79,12 @@ void QAbstractAspectPrivate::onEngineAboutToShutdown()
{
}
+/*! \internal */
+void QAbstractAspectPrivate::unregisterBackendType(const QMetaObject &mo)
+{
+ m_backendCreatorFunctors.remove(&mo);
+}
+
/*!
* \class Qt3DCore::QAbstractAspect
* \inherits QObject