aboutsummaryrefslogtreecommitdiff
path: root/src/library_glut.js
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2012-04-05 02:29:22 -0400
committerBehdad Esfahbod <behdad@behdad.org>2012-04-05 02:30:27 -0400
commit7224e7e46e34fe4e1c282bc0641127a1c80f4161 (patch)
treee52b61065aa3af5118fa52817ac93c0897d27a75 /src/library_glut.js
parentd71d91fc45923c760146f0b5c3075a0bbe7f7814 (diff)
Don't rely on _atexit() accepting JS functions
Diffstat (limited to 'src/library_glut.js')
-rw-r--r--src/library_glut.js6
1 files changed, 3 insertions, 3 deletions
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();