fix crash in Cocoa when SDL_RedrawCursor sends NULL to ShowCursor

Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com>
This commit is contained in:
Victor Ilyushchenko
2025-10-20 22:21:57 +03:00
committed by Frank Praznik
parent 91a5598283
commit 544772173f

View File

@@ -275,11 +275,13 @@ static bool Cocoa_ShowCursor(SDL_Cursor *cursor)
SDL_VideoDevice *device = SDL_GetVideoDevice(); SDL_VideoDevice *device = SDL_GetVideoDevice();
SDL_Window *window = (device ? device->windows : NULL); SDL_Window *window = (device ? device->windows : NULL);
SDL_CursorData *cdata = cursor->internal; if (cursor != NULL) {
cdata->current_frame = 0; SDL_CursorData *cdata = cursor->internal;
if (cdata->frameTimer) { cdata->current_frame = 0;
[cdata->frameTimer invalidate]; if (cdata->frameTimer) {
cdata->frameTimer = nil; [cdata->frameTimer invalidate];
cdata->frameTimer = nil;
}
} }
for (; window != NULL; window = window->next) { for (; window != NULL; window = window->next) {