[Commits] SDL: Removed redundant mouse clean up on quit for some platforms.

libsdl.org revision control commits-owner at libsdl.org
Fri May 19 14:40:15 PDT 2017


details:   https://hg.libsdl.org/SDL/rev/97839b6bbd46
changeset: 11019:97839b6bbd46
user:      Philipp Wiesemann <philipp.wiesemann at arcor.de>
date:      Fri May 19 23:30:59 2017 +0200
description:
Removed redundant mouse clean up on quit for some platforms.

SDL_MouseQuit() already frees cursors and sets fields to NULL.

diffstat:

 src/video/emscripten/SDL_emscriptenmouse.c |  11 -----------
 src/video/mir/SDL_mirmouse.c               |  11 -----------
 src/video/wayland/SDL_waylandmouse.c       |  18 ------------------
 src/video/windows/SDL_windowsmouse.c       |   7 -------
 4 files changed, 0 insertions(+), 47 deletions(-)

diffs (86 lines):

diff -r 1f151426c2ca -r 97839b6bbd46 src/video/emscripten/SDL_emscriptenmouse.c
--- a/src/video/emscripten/SDL_emscriptenmouse.c	Fri May 19 15:06:05 2017 -0400
+++ b/src/video/emscripten/SDL_emscriptenmouse.c	Fri May 19 23:30:59 2017 +0200
@@ -262,17 +262,6 @@
 void
 Emscripten_FiniMouse()
 {
-    SDL_Mouse* mouse = SDL_GetMouse();
-
-    Emscripten_FreeCursor(mouse->def_cursor);
-    mouse->def_cursor = NULL;
-
-    mouse->CreateCursor         = NULL;
-    mouse->ShowCursor           = NULL;
-    mouse->FreeCursor           = NULL;
-    mouse->WarpMouse            = NULL;
-    mouse->CreateSystemCursor   = NULL;
-    mouse->SetRelativeMouseMode = NULL;
 }
 
 #endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN */
diff -r 1f151426c2ca -r 97839b6bbd46 src/video/mir/SDL_mirmouse.c
--- a/src/video/mir/SDL_mirmouse.c	Fri May 19 15:06:05 2017 -0400
+++ b/src/video/mir/SDL_mirmouse.c	Fri May 19 23:30:59 2017 +0200
@@ -284,17 +284,6 @@
 void
 MIR_FiniMouse()
 {
-    SDL_Mouse* mouse = SDL_GetMouse();
-
-    MIR_FreeCursor(mouse->def_cursor);
-    mouse->def_cursor = NULL;
-
-    mouse->CreateCursor         = NULL;
-    mouse->ShowCursor           = NULL;
-    mouse->FreeCursor           = NULL;
-    mouse->WarpMouse            = NULL;
-    mouse->CreateSystemCursor   = NULL;
-    mouse->SetRelativeMouseMode = NULL;
 }
 
 #endif /* SDL_VIDEO_DRIVER_MIR */
diff -r 1f151426c2ca -r 97839b6bbd46 src/video/wayland/SDL_waylandmouse.c
--- a/src/video/wayland/SDL_waylandmouse.c	Fri May 19 15:06:05 2017 -0400
+++ b/src/video/wayland/SDL_waylandmouse.c	Fri May 19 23:30:59 2017 +0200
@@ -392,23 +392,5 @@
     /* This effectively assumes that nobody else
      * touches SDL_Mouse which is effectively
      * a singleton */
-
-    SDL_Mouse *mouse = SDL_GetMouse();
-
-    /* Free the current cursor if not the same pointer as
-     * the default cursor */
-    if (mouse->def_cursor != mouse->cur_cursor)
-        Wayland_FreeCursor (mouse->cur_cursor);
-
-    Wayland_FreeCursor (mouse->def_cursor);
-    mouse->def_cursor = NULL;
-    mouse->cur_cursor = NULL;
-
-    mouse->CreateCursor =  NULL;
-    mouse->CreateSystemCursor = NULL;
-    mouse->ShowCursor = NULL;
-    mouse->FreeCursor = NULL;
-    mouse->WarpMouse = NULL;
-    mouse->SetRelativeMouseMode = NULL;
 }
 #endif  /* SDL_VIDEO_DRIVER_WAYLAND */
diff -r 1f151426c2ca -r 97839b6bbd46 src/video/windows/SDL_windowsmouse.c
--- a/src/video/windows/SDL_windowsmouse.c	Fri May 19 15:06:05 2017 -0400
+++ b/src/video/windows/SDL_windowsmouse.c	Fri May 19 23:30:59 2017 +0200
@@ -311,13 +311,6 @@
 void
 WIN_QuitMouse(_THIS)
 {
-    SDL_Mouse *mouse = SDL_GetMouse();
-    if ( mouse->def_cursor ) {
-        SDL_free(mouse->def_cursor);
-        mouse->def_cursor = NULL;
-        mouse->cur_cursor = NULL;
-    }
-
     if (rawInputEnableCount) {  /* force RAWINPUT off here. */
         rawInputEnableCount = 1;
         ToggleRawInput(SDL_FALSE);


More information about the commits mailing list