From da4ceb7cbcb7ada3e8223afae9c3af5460ccbaf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 28 Mar 2013 13:09:45 +0100 Subject: [PATCH] Delete VAO in Mesh only if it is nonzero. glDeleteVertexArrays() was called even after the Mesh was moved out to another object. On my NVidia it was working but it might cause issues elsewhere. --- src/Mesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mesh.cpp b/src/Mesh.cpp index 169a78ffd..d94e4d1a2 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -230,7 +230,7 @@ void Mesh::destroyImplementationDefault() {} void Mesh::destroyImplementationVAO() { /** @todo Get some extension wrangler instead to avoid linker errors to glDeleteVertexArrays() on ES2 */ #ifndef MAGNUM_TARGET_GLES2 - glDeleteVertexArrays(1, &vao); + if(vao) glDeleteVertexArrays(1, &vao); #endif }