You should be able to set `noExitRuntime = 0` and then call `exit(0)` (or `Module.exit(0)`).
cheers, sam On Mon, Mar 22, 2021 at 10:47 AM Christopher Dyken < [email protected]> wrote: > Hi, > > I use emscripten for a project where I set noExitRuntime=1 since I want to > manage the main loop myself in javascript-land. And that works well. > > However, I also need to shut down and clean up the module, but I haven't > managed to find a way to invoke the shutdown code? > > I'm considering trying to do the init code in a dedicated function using > noInitialRun=1 and call main() for shutdown. But maybe I am missing > something? > > Thanks, > > Christopher > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/a3a32735-9904-4a21-bf0b-fa118c3569a3n%40googlegroups.com > <https://groups.google.com/d/msgid/emscripten-discuss/a3a32735-9904-4a21-bf0b-fa118c3569a3n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAL_va2--0xDu7qP2CPQ01Y0W1hwax9v%2BXdBPxOZk4RRb2UQapw%40mail.gmail.com.
