aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@digia.com>2014-09-11 12:23:37 +0200
committerAndy Nichols <andy.nichols@digia.com>2014-09-11 12:58:28 +0200
commite471398395508ce156bf9a287920393f838f2b22 (patch)
tree78af72e6eaadee4ce876a16f503014fe66dd9e56 /src/particles
parent7ddb567f7cced8beed147c42b8c79fc017d260ee (diff)
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 <lars.knoll@digia.com>
Diffstat (limited to 'src/particles')
-rw-r--r--src/particles/qquickimageparticle.cpp3
1 files changed, 3 insertions, 0 deletions
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;