diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-04-18 18:13:27 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-04-18 18:13:27 -0700 |
commit | adde613fd2c04af97d189132609582d46f07b5cf (patch) | |
tree | 4a913e0c930725fc26af0672f9ec0fbbe74e55d4 /src/library_browser.js | |
parent | b89463c712d84b4fe28ae86198266690edd26e45 (diff) |
do not exit the runtime if doing anything async
Diffstat (limited to 'src/library_browser.js')
-rw-r--r-- | src/library_browser.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/library_browser.js b/src/library_browser.js index 299e8a72..66aeeaf8 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -4,6 +4,8 @@ mergeInto(LibraryManager.library, { emscripten_set_main_loop: function(func, fps) { + Module['noExitRuntime'] = true; + fps = fps || 60; // TODO: use requestAnimationFrame _emscripten_set_main_loop.cancel = false; var jsFunc = FUNCTION_TABLE[func]; @@ -20,6 +22,8 @@ mergeInto(LibraryManager.library, { }, emscripten_async_call: function(func, millis) { + Module['noExitRuntime'] = true; + // TODO: cache these to avoid generating garbage setTimeout(function() { FUNCTION_TABLE[func](); |