summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJere Tuliniemi <jere.tuliniemi@qt.io>2019-06-07 14:52:22 +0300
committerJere Tuliniemi <jere.tuliniemi@qt.io>2019-06-07 14:52:22 +0300
commitfe7649841f68c6fe99bf08e477df77770c7dffa0 (patch)
tree3296fabc4515d8967fcb1d84df79f972145af100
parent61823aaccc6510699a54b34a2fe3f7523dab3b4e (diff)
Fix black screen after opening another presentation
When the clean up operations were done for the engine, the OpenGL context was wrong causing wrong vertex array objects to be deleted. This sets the context to be correct during the clean up. Task-number: QT3DS-3638 Change-Id: Id588c5b0513e44953df7164e7ef41ae66a668122 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/Authoring/Studio/Application/StudioApp.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Authoring/Studio/Application/StudioApp.cpp b/src/Authoring/Studio/Application/StudioApp.cpp
index c7264c97..f3594c94 100644
--- a/src/Authoring/Studio/Application/StudioApp.cpp
+++ b/src/Authoring/Studio/Application/StudioApp.cpp
@@ -1810,7 +1810,12 @@ void CStudioApp::OnLoadDocumentCatcher(const QString &inDocument)
{
{
CDispatchDataModelNotificationScope __scope(*m_core->GetDispatch());
+
+ // CloseDocument() clears all the OpenGL buffers so it needs the correct context
+ getRenderer().MakeContextCurrent();
m_core->GetDoc()->CloseDocument();
+ getRenderer().ReleaseContext();
+
m_core->GetDoc()->LoadDocument(inDocument);
}