Commit 45e5f0f10bd44022cb3df3808eaa14ebb1eb2e4e

Sylvain 2023-02-13T09:40:44

Fixed bug #7302 - Memory 'leak' in SDL_SetMouseSystemScale()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c
index fa0a582..5d8d1d2 100644
--- a/src/events/SDL_mouse.c
+++ b/src/events/SDL_mouse.c
@@ -912,6 +912,12 @@ void SDL_MouseQuit(void)
     }
     mouse->num_clickstates = 0;
 
+    if (mouse->system_scale_values) {
+        SDL_free(mouse->system_scale_values);
+        mouse->system_scale_values = NULL;
+    }
+    mouse->num_system_scale_values = 0;
+
     SDL_DelHintCallback(SDL_HINT_MOUSE_DOUBLE_CLICK_TIME,
                         SDL_MouseDoubleClickTimeChanged, mouse);