@@ -83,17 +83,25 @@ var VERBOSE = false;
83
83
// [link]
84
84
var INVOKE_RUN = true ;
85
85
86
- // If 0, the runtime is not quit when main() completes (allowing code to
87
- // run afterwards, for example from the browser main event loop). atexit()s
88
- // are also not executed, and we can avoid including code for runtime shutdown,
89
- // like flushing the stdio streams.
90
- // Set this to 1 if you do want atexit()s or stdio streams to be flushed
91
- // on exit.
86
+ // If 0, support for shutting down the runtime is not emitted into the build.
87
+ // This means that the program is not quit when main() completes, but execution
88
+ // will yield to the event loop of the JS environment, allowing event handlers
89
+ // to run afterwards. If 0, C++ global destructors will not be emitted into the
90
+ // build either, to save on code size. Calling exit() will throw an unwinding
91
+ // exception, but will not shut down the runtime.
92
+ //
93
+ // Set this to 1 if you do want to retain the ability to shut down the program.
94
+ // If 1, then completing main() will by default call exit(), unless a refcount
95
+ // keeps the runtime alive. Call emscripten_exit_with_live_runtime() to finish
96
+ // main() while keeping the runtime alive. Calling emscripten_force_exit() will
97
+ // shut down the runtime, invoking atexit()s, and flushing stdio streams.
92
98
// This setting is controlled automatically in STANDALONE_WASM mode:
93
99
//
94
100
// - For a command (has a main function) this is always 1
95
- // - For a reactor (no a main function) this is always 0
101
+ // - For a reactor (no main function) this is always 0
96
102
//
103
+ // For more details, see documentation for emscripten_force_exit() and
104
+ // emscripten_exit_with_live_runtime().
97
105
// [link]
98
106
var EXIT_RUNTIME = false ;
99
107
0 commit comments