From 7224e7e46e34fe4e1c282bc0641127a1c80f4161 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 5 Apr 2012 02:29:22 -0400 Subject: Don't rely on _atexit() accepting JS functions --- src/library_glut.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/library_glut.js') diff --git a/src/library_glut.js b/src/library_glut.js index 257431c7..a7d9cb5b 100644 --- a/src/library_glut.js +++ b/src/library_glut.js @@ -406,7 +406,7 @@ var LibraryGLUT = { } }, - glutMainLoop__deps: ['$GLUT', 'atexit', 'glutPostRedisplay'], + glutMainLoop__deps: ['$GLUT', 'glutPostRedisplay'], glutMainLoop: function() { window.addEventListener("keydown", GLUT.onKeydown, true); @@ -415,13 +415,13 @@ var LibraryGLUT = { window.addEventListener("mousedown", GLUT.onMouseButtonDown, true); window.addEventListener("mouseup", GLUT.onMouseButtonUp, true); - _atexit(function() { + __ATEXIT__.push({ func: function() { window.removeEventListener("keydown", GLUT.onKeydown, true); window.removeEventListener("keyup", GLUT.onKeyup, true); window.removeEventListener("mousemove", GLUT.onMousemove, true); window.removeEventListener("mousedown", GLUT.onMouseButtonDown, true); window.removeEventListener("mouseup", GLUT.onMouseButtonUp, true); - }); + } }); _glutReshapeWindow(Module['canvas'].width, Module['canvas'].height); _glutPostRedisplay(); -- cgit v1.2.3-18-g5258