add support for 'onShutdown' handler to do stuff after game is done
authorTaylor Richards <taylor@icculus.org>
Wed, 28 Feb 2018 21:34:49 +0000 (16:34 -0500)
committerTaylor Richards <taylor@icculus.org>
Sat, 17 Mar 2018 15:31:16 +0000 (11:31 -0400)
src/freespace2/freespace.cpp

index 040bbab..a452551 100644 (file)
@@ -6941,6 +6941,15 @@ void game_shutdown(void)
        if(Multi_update_fireup_launcher_on_exit){
                game_launch_launcher_on_exit();
        }
+
+#ifdef __EMSCRIPTEN__
+       // sync files to persistent storage
+       EM_ASM({
+               if (Module['onShutdown']) {
+                       Module['onShutdown']();
+               }
+       });
+#endif
 }
 
 // game_stop_looped_sounds()