From 588338b65b75de7c2981e8d1bb1e7fc85ab558d8 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 9 Feb 2016 19:51:19 +0100 Subject: QtGui: replace a Q_FOREACH loop with qDeleteAll() Change-Id: Ibb26338809ffccc3a736a7c53ac4f5877cac34a8 Reviewed-by: Gunnar Sletta Reviewed-by: Olivier Goffart (Woboq GmbH) Reviewed-by: Lars Knoll --- src/gui/opengl/qopenglshaderprogram.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/gui/opengl/qopenglshaderprogram.cpp') diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp index 224ce388b3f..afdb1133ea8 100644 --- a/src/gui/opengl/qopenglshaderprogram.cpp +++ b/src/gui/opengl/qopenglshaderprogram.cpp @@ -993,10 +993,8 @@ void QOpenGLShaderProgram::removeAllShaders() d->glfuncs->glDetachShader(d->programGuard->id(), shader->d_func()->shaderGuard->id()); } } - foreach (QOpenGLShader *shader, d->anonShaders) { - // Delete shader objects that were created anonymously. - delete shader; - } + // Delete shader objects that were created anonymously. + qDeleteAll(d->anonShaders); d->shaders.clear(); d->anonShaders.clear(); d->linked = false; // Program needs to be relinked. -- cgit v1.2.3