From e471398395508ce156bf9a287920393f838f2b22 Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Thu, 11 Sep 2014 12:23:37 +0200 Subject: Check for a current QOpenGLContext before use We can not assume that there will be a current OpenGL context to use in QQuickImageParticle so now there is a check before we make a call to the current context. Change-Id: I0c77895d0b0f1afdf4853c0486fba0ef9a7b883d Reviewed-by: Lars Knoll --- src/particles/qquickimageparticle.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp index 08d3142701..60a67d55a6 100644 --- a/src/particles/qquickimageparticle.cpp +++ b/src/particles/qquickimageparticle.cpp @@ -1223,6 +1223,9 @@ void QQuickImageParticle::buildParticleNodes(QSGNode** passThrough) void QQuickImageParticle::finishBuildParticleNodes(QSGNode** node) { + if (!QOpenGLContext::currentContext()) + return; + if (QOpenGLContext::currentContext()->isOpenGLES() && m_count * 4 > 0xffff) { printf("ImageParticle: Too many particles - maximum 16,000 per ImageParticle.\n");//ES 2 vertex count limit is ushort return; -- cgit v1.2.3