Fixed crash if X11 initialization fails

This commit is contained in:
Sam Lantinga committed 2025-08-13 19:44:13 -07:00
1 parent 45feacf608
commit eeae48464e
1 file changed
+4 -2
+4 -2
View File
@@ -536,8 +536,10 @@ void X11_QuitMouse(SDL_VideoDevice *_this)
int j;
for (j = 0; j < SDL_arraysize(sys_cursors); j++) {
X11_FreeCursor(sys_cursors[j]);
sys_cursors[j] = NULL;
if (sys_cursors[j]) {
X11_FreeCursor(sys_cursors[j]);
sys_cursors[j] = NULL;
}
}
for (i = data->mouse_device_info; i; i = next) {