emscripten: Fix crash in SDL_SetWindowTitle().
authorRyan C. Gordon <icculus@icculus.org>
Wed, 13 May 2020 16:48:42 -0400
changeset 13806ed5f41281cb0
parent 13805 4709c1dfeabb
child 13807 e3396aa005df
emscripten: Fix crash in SDL_SetWindowTitle().

This patch came from emscripten-ports, thanks!

Fixes Bugzilla #5133.
src/video/emscripten/SDL_emscriptenvideo.c
     1.1 --- a/src/video/emscripten/SDL_emscriptenvideo.c	Fri Apr 17 13:55:44 2020 -0400
     1.2 +++ b/src/video/emscripten/SDL_emscriptenvideo.c	Wed May 13 16:48:42 2020 -0400
     1.3 @@ -366,8 +366,8 @@
     1.4  static void
     1.5  Emscripten_SetWindowTitle(_THIS, SDL_Window * window) {
     1.6      EM_ASM_INT({
     1.7 -      if (typeof Module['setWindowTitle'] !== 'undefined') {
     1.8 -        Module['setWindowTitle'](UTF8ToString($0));
     1.9 +      if (typeof setWindowTitle !== 'undefined') {
    1.10 +        setWindowTitle(UTF8ToString($0));
    1.11        }
    1.12        return 0;
    1.13      }, window->title);