Removed redundant mouse clean up on quit for some platforms.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Fri, 19 May 2017 23:30:59 +0200
changeset 1101997839b6bbd46
parent 11018 1f151426c2ca
child 11020 3b993dbe4cf9
Removed redundant mouse clean up on quit for some platforms.

SDL_MouseQuit() already frees cursors and sets fields to NULL.
src/video/emscripten/SDL_emscriptenmouse.c
src/video/mir/SDL_mirmouse.c
src/video/wayland/SDL_waylandmouse.c
src/video/windows/SDL_windowsmouse.c
     1.1 --- a/src/video/emscripten/SDL_emscriptenmouse.c	Fri May 19 15:06:05 2017 -0400
     1.2 +++ b/src/video/emscripten/SDL_emscriptenmouse.c	Fri May 19 23:30:59 2017 +0200
     1.3 @@ -262,17 +262,6 @@
     1.4  void
     1.5  Emscripten_FiniMouse()
     1.6  {
     1.7 -    SDL_Mouse* mouse = SDL_GetMouse();
     1.8 -
     1.9 -    Emscripten_FreeCursor(mouse->def_cursor);
    1.10 -    mouse->def_cursor = NULL;
    1.11 -
    1.12 -    mouse->CreateCursor         = NULL;
    1.13 -    mouse->ShowCursor           = NULL;
    1.14 -    mouse->FreeCursor           = NULL;
    1.15 -    mouse->WarpMouse            = NULL;
    1.16 -    mouse->CreateSystemCursor   = NULL;
    1.17 -    mouse->SetRelativeMouseMode = NULL;
    1.18  }
    1.19  
    1.20  #endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN */
     2.1 --- a/src/video/mir/SDL_mirmouse.c	Fri May 19 15:06:05 2017 -0400
     2.2 +++ b/src/video/mir/SDL_mirmouse.c	Fri May 19 23:30:59 2017 +0200
     2.3 @@ -284,17 +284,6 @@
     2.4  void
     2.5  MIR_FiniMouse()
     2.6  {
     2.7 -    SDL_Mouse* mouse = SDL_GetMouse();
     2.8 -
     2.9 -    MIR_FreeCursor(mouse->def_cursor);
    2.10 -    mouse->def_cursor = NULL;
    2.11 -
    2.12 -    mouse->CreateCursor         = NULL;
    2.13 -    mouse->ShowCursor           = NULL;
    2.14 -    mouse->FreeCursor           = NULL;
    2.15 -    mouse->WarpMouse            = NULL;
    2.16 -    mouse->CreateSystemCursor   = NULL;
    2.17 -    mouse->SetRelativeMouseMode = NULL;
    2.18  }
    2.19  
    2.20  #endif /* SDL_VIDEO_DRIVER_MIR */
     3.1 --- a/src/video/wayland/SDL_waylandmouse.c	Fri May 19 15:06:05 2017 -0400
     3.2 +++ b/src/video/wayland/SDL_waylandmouse.c	Fri May 19 23:30:59 2017 +0200
     3.3 @@ -392,23 +392,5 @@
     3.4      /* This effectively assumes that nobody else
     3.5       * touches SDL_Mouse which is effectively
     3.6       * a singleton */
     3.7 -
     3.8 -    SDL_Mouse *mouse = SDL_GetMouse();
     3.9 -
    3.10 -    /* Free the current cursor if not the same pointer as
    3.11 -     * the default cursor */
    3.12 -    if (mouse->def_cursor != mouse->cur_cursor)
    3.13 -        Wayland_FreeCursor (mouse->cur_cursor);
    3.14 -
    3.15 -    Wayland_FreeCursor (mouse->def_cursor);
    3.16 -    mouse->def_cursor = NULL;
    3.17 -    mouse->cur_cursor = NULL;
    3.18 -
    3.19 -    mouse->CreateCursor =  NULL;
    3.20 -    mouse->CreateSystemCursor = NULL;
    3.21 -    mouse->ShowCursor = NULL;
    3.22 -    mouse->FreeCursor = NULL;
    3.23 -    mouse->WarpMouse = NULL;
    3.24 -    mouse->SetRelativeMouseMode = NULL;
    3.25  }
    3.26  #endif  /* SDL_VIDEO_DRIVER_WAYLAND */
     4.1 --- a/src/video/windows/SDL_windowsmouse.c	Fri May 19 15:06:05 2017 -0400
     4.2 +++ b/src/video/windows/SDL_windowsmouse.c	Fri May 19 23:30:59 2017 +0200
     4.3 @@ -311,13 +311,6 @@
     4.4  void
     4.5  WIN_QuitMouse(_THIS)
     4.6  {
     4.7 -    SDL_Mouse *mouse = SDL_GetMouse();
     4.8 -    if ( mouse->def_cursor ) {
     4.9 -        SDL_free(mouse->def_cursor);
    4.10 -        mouse->def_cursor = NULL;
    4.11 -        mouse->cur_cursor = NULL;
    4.12 -    }
    4.13 -
    4.14      if (rawInputEnableCount) {  /* force RAWINPUT off here. */
    4.15          rawInputEnableCount = 1;
    4.16          ToggleRawInput(SDL_FALSE);