Hi all,
what is the proper way to handle application exit? For instance, what's the proper code when your main is setup as such (simulated infinite loop) :
void update(void* args)
{
App* app = (App*)args;
app->update();
}
int main()
{
init_systems();
auto app = new App;
emscripten_set_main_loop_arg(&update, app, 0, true);
delete app;
free_systems();
}
How do we exit the emscripten main loop and continue executing whatever code that exist beyond the main loop?
On a similar topic, upon assertions/errors in code, how do we completely stop the application/javascript with a behavior similar to C exit(code) function? When we call exit(code), it seems main loop is still running?
What's the general guideline for application life cycle?
Thanks!