Fixed cursor leak when quitting the mouse subsystem
This commit is contained in:
parent
958740dffc
commit
080517ecba
2 changed files with 17 additions and 2 deletions
|
@ -361,6 +361,23 @@ SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y)
|
||||||
void
|
void
|
||||||
SDL_MouseQuit(void)
|
SDL_MouseQuit(void)
|
||||||
{
|
{
|
||||||
|
SDL_Cursor *cursor, *next;
|
||||||
|
SDL_Mouse *mouse = SDL_GetMouse();
|
||||||
|
|
||||||
|
SDL_ShowCursor(1);
|
||||||
|
|
||||||
|
cursor = mouse->cursors;
|
||||||
|
while (cursor) {
|
||||||
|
next = cursor->next;
|
||||||
|
SDL_FreeCursor(cursor);
|
||||||
|
cursor = next;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mouse->def_cursor && mouse->FreeCursor) {
|
||||||
|
mouse->FreeCursor(mouse->def_cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
SDL_zerop(mouse);
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint32
|
Uint32
|
||||||
|
|
|
@ -2247,8 +2247,6 @@ SDL_VideoQuit(void)
|
||||||
|
|
||||||
SDL_EnableScreenSaver();
|
SDL_EnableScreenSaver();
|
||||||
|
|
||||||
SDL_ShowCursor(1);
|
|
||||||
|
|
||||||
/* Clean up the system video */
|
/* Clean up the system video */
|
||||||
while (_this->windows) {
|
while (_this->windows) {
|
||||||
SDL_DestroyWindow(_this->windows);
|
SDL_DestroyWindow(_this->windows);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue