summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-19 16:44:46 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-19 16:58:43 +0000
commit9d68e897ad80c092cee215f8254c40210d59c122 (patch)
tree5ed38c29f18a779e83ef47a54995fb1fb22b71f9 /src
parentc6477a7cf592c335c027429b8a8066a20b812b87 (diff)
Avoid crashing when becoming non-exposed
On Android Qt3D apps used to crash when they got moved to background. beginDrawing() correctly recognized that the window was not exposed anymore, but some of the cleanup for the render queue was not done in this case. This is now corrected, so apps will survive. It is not the full solution because we still continue to attempt to render which is a waste of CPU time. Proper pause and resume will have to be implemented later, similarly to the Quick scenegraph render loops, based on the expose events. Change-Id: Ia567d891fc746bb6851524e0f8a998a8fd53f8b1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/render/backend/renderer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/render/backend/renderer.cpp b/src/render/backend/renderer.cpp
index 7ad3813ce..e512bda1b 100644
--- a/src/render/backend/renderer.cpp
+++ b/src/render/backend/renderer.cpp
@@ -593,8 +593,11 @@ void Renderer::submitRenderViews(int maxFrameCount)
continue;
// Bail out if we cannot make the OpenGL context current (e.g. if the window has been destroyed)
- if (!m_graphicsContext->beginDrawing(m_surface, renderViews.first()->clearColor()))
+ if (!m_graphicsContext->beginDrawing(m_surface, renderViews.first()->clearColor())) {
+ qDeleteAll(renderViews);
+ m_renderQueues->popFrameQueue();
break;
+ }
if (!defaultFboIdValid) {
defaultFboIdValid = true;