mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-27 10:51:54 +00:00
mouse: Free the default cursor when destroyed
The default cursor was being leaked on destruction as it is not in the cursor list, and subsequently SDL_DestroyCursor() wouldn't call the free function for it.
This commit is contained in:
@@ -239,7 +239,11 @@ void SDL_SetDefaultCursor(SDL_Cursor *cursor)
|
||||
}
|
||||
mouse->def_cursor = NULL;
|
||||
|
||||
SDL_DestroyCursor(default_cursor);
|
||||
if (mouse->FreeCursor && default_cursor->driverdata) {
|
||||
mouse->FreeCursor(default_cursor);
|
||||
} else {
|
||||
SDL_free(default_cursor);
|
||||
}
|
||||
}
|
||||
|
||||
mouse->def_cursor = cursor;
|
||||
|
||||
Reference in New Issue
Block a user