Commit daf360e04048cd5bba6b78fa886c3990d0b497ff

Ryan C. Gordon 2020-05-13T16:48:42

emscripten: Fix crash in SDL_SetWindowTitle(). This patch came from emscripten-ports, thanks! Fixes Bugzilla #5133.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/video/emscripten/SDL_emscriptenvideo.c b/src/video/emscripten/SDL_emscriptenvideo.c
index 295032f..3845346 100644
--- a/src/video/emscripten/SDL_emscriptenvideo.c
+++ b/src/video/emscripten/SDL_emscriptenvideo.c
@@ -366,8 +366,8 @@ Emscripten_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * di
 static void
 Emscripten_SetWindowTitle(_THIS, SDL_Window * window) {
     EM_ASM_INT({
-      if (typeof Module['setWindowTitle'] !== 'undefined') {
-        Module['setWindowTitle'](UTF8ToString($0));
+      if (typeof setWindowTitle !== 'undefined') {
+        setWindowTitle(UTF8ToString($0));
       }
       return 0;
     }, window->title);