diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-04-11 16:21:54 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-23 09:10:18 +0200 |
commit | 4e4228e0b1c01edada84d82746e3360aeffeb037 (patch) | |
tree | f39531393885e6940c6e4940f202c1a40a104f13 /src/quick/scenegraph/util/qsgatlastexture.cpp | |
parent | 964dcdfb7bc106696b4be12b7f71ba52f8448973 (diff) |
Support shutting down the render thread without an OpenGL context.
[ChangeLog][QtQuick][SceneGraph] There might not be an OpenGL context
bound when QQuickWindow::sceneGraphInvalidated() is emitted if an
error occurs while cleaning up the scene graph (such as
EGL_CONTEXT_LOST). This is according to the documentation, but has
never occurred in practice before.
Change-Id: I13dbfbb4b6d0d27fa42fcb8b54df16ea02284807
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick/scenegraph/util/qsgatlastexture.cpp')
-rw-r--r-- | src/quick/scenegraph/util/qsgatlastexture.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp index 997d58de0f..99d1d60258 100644 --- a/src/quick/scenegraph/util/qsgatlastexture.cpp +++ b/src/quick/scenegraph/util/qsgatlastexture.cpp @@ -185,11 +185,9 @@ Atlas::~Atlas() void Atlas::invalidate() { - Q_ASSERT(QOpenGLContext::currentContext()); - if (m_texture_id) { + if (m_texture_id && QOpenGLContext::currentContext()) glDeleteTextures(1, &m_texture_id); - m_texture_id = 0; - } + m_texture_id = 0; } Texture *Atlas::create(const QImage &image) |