From 04b1494cf8aa9a756345138954c44df7032496a8 Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Tue, 29 Jan 2019 12:19:23 +0000 Subject: [PATCH] Emscripten: resize canvas to 0x0 in DestroyWindow Closest we can get to actually destroying it --- src/video/emscripten/SDL_emscriptenvideo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video/emscripten/SDL_emscriptenvideo.c b/src/video/emscripten/SDL_emscriptenvideo.c index 582bec14c..513178656 100644 --- a/src/video/emscripten/SDL_emscriptenvideo.c +++ b/src/video/emscripten/SDL_emscriptenvideo.c @@ -293,6 +293,10 @@ Emscripten_DestroyWindow(_THIS, SDL_Window * window) data->egl_surface = EGL_NO_SURFACE; } #endif + + /* We can't destroy the canvas, so resize it to zero instead */ + emscripten_set_canvas_element_size(NULL, 0, 0); + SDL_free(window->driverdata); window->driverdata = NULL; }