aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-06-18 17:44:26 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-06-18 17:44:26 -0700
commit88983850f344ed548cac89c6e263c58afab1fcc0 (patch)
tree8635d4c5fa91c3dd30da65ff023b6086583f2efb
parente7aaa7e6bb1f0518f98717a8158efb7f429a73ee (diff)
silently ignore invalid textures in glDeleteTextures, per the spec
-rw-r--r--src/library_gl.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 467470bc..e67ec29b 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -833,6 +833,7 @@ var LibraryGL = {
for (var i = 0; i < n; i++) {
var id = {{{ makeGetValue('textures', 'i*4', 'i32') }}};
var texture = GL.textures[id];
+ if (!texture) continue;
GLctx.deleteTexture(texture);
texture.name = 0;
GL.textures[id] = null;