diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-05-27 10:41:55 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-05-27 10:41:55 -0700 |
commit | 2fe956af7c49a656c40747c0e79eb4728129fac3 (patch) | |
tree | 470a3388b3221f53005702ca01b3aa784f9015a4 | |
parent | 4d6a04143f094293e1d4c969a56020b2a33c6ad8 (diff) |
emscripten_exit_with_live_runtime
-rw-r--r-- | src/library_browser.js | 5 | ||||
-rw-r--r-- | system/include/emscripten/emscripten.h | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/library_browser.js b/src/library_browser.js index 2e6c9150..1a79a49b 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -754,6 +754,11 @@ mergeInto(LibraryManager.library, { } }, + emscripten_exit_with_live_runtime: function() { + Module['noExitRuntime'] = true; + throw 'SimulateInfiniteLoop'; + }, + emscripten_hide_mouse: function() { var styleSheet = document.styleSheets[0]; var rules = styleSheet.cssRules; diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h index 61634b0e..77aa1df2 100644 --- a/system/include/emscripten/emscripten.h +++ b/system/include/emscripten/emscripten.h @@ -136,6 +136,14 @@ inline void emscripten_async_call(void (*func)(void *), void *arg, int millis) { #endif /* + * Exits the program immediately, but leaves the runtime alive + * so that you can continue to run code later (so global destructors + * etc. are not run). This is implicitly performed when you do + * an asynchronous operation like emscripten_async_call. + */ +extern void emscripten_exit_with_live_runtime(); + +/* * Hide the OS mouse cursor over the canvas. Note that SDL's * SDL_ShowCursor command shows and hides the SDL cursor, not * the OS one. This command is useful to hide the OS cursor |