mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 11:35:08 -04:00
Web: Fix canvas not auto clearing when client is exited with an error (e.g. invalid port)
This commit is contained in:
parent
d3a9477470
commit
1c786570e4
@ -358,7 +358,12 @@ cc_result Socket_Poll(cc_socket s, int mode, cc_bool* success) {
|
||||
*-----------------------------------------------------Process/Module------------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
cc_result Process_StartGame(const cc_string* args) { return ERR_NOT_SUPPORTED; }
|
||||
void Process_Exit(cc_result code) { exit(code); }
|
||||
void Process_Exit(cc_result code) {
|
||||
/* Window isn't implicitly closed when process is exited */
|
||||
if (code) Window_Close();
|
||||
|
||||
exit(code);
|
||||
}
|
||||
|
||||
extern int interop_OpenTab(const char* url);
|
||||
cc_result Process_StartOpen(const cc_string* args) {
|
||||
|
@ -488,6 +488,9 @@ void Window_Close(void) {
|
||||
Window_DisableRawMouse();
|
||||
Window_SetSize(0, 0);
|
||||
UnhookEvents();
|
||||
/* Game_DoFrame doesn't do anything when WindowExists.False is false, */
|
||||
/* but it's still better to cancel main loop to minimise resource usage */
|
||||
emscripten_cancel_main_loop();
|
||||
}
|
||||
|
||||
extern void interop_RequestCanvasResize(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user