From 7eeca829e5c4f84f0dcb97f4ecbb851c6760c7f9 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 12 Sep 2016 08:11:38 -0300 Subject: [PATCH] Fix a use of std::remove_if --HG-- branch : minor --- src/modules/window/sdl/Window.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/window/sdl/Window.cpp b/src/modules/window/sdl/Window.cpp index 33f3a2556..793b768e7 100644 --- a/src/modules/window/sdl/Window.cpp +++ b/src/modules/window/sdl/Window.cpp @@ -245,10 +245,12 @@ std::vector Window::getContextAttribsList() const if (removeES3) { - std::remove_if(attribslist.begin(), attribslist.end(), [](ContextAttribs a) + auto it = std::remove_if(attribslist.begin(), attribslist.end(), [](ContextAttribs a) { return a.gles && a.versionMajor >= 3; }); + + attribslist.erase(it, attribslist.end()); } // Move OpenGL ES to the front of the list if we should prefer GLES.