Browse Source

RPI_FreeCursor: set global_cursor to NULL to prevent double-free (bug 4769)

Ozkan Sezer 5 years ago
parent
commit
1e47790c8d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/video/raspberry/SDL_rpimouse.c

+ 3 - 0
src/video/raspberry/SDL_rpimouse.c

@@ -226,6 +226,9 @@ RPI_FreeCursor(SDL_Cursor * cursor)
             SDL_free(cursor->driverdata);
         }
         SDL_free(cursor);
+        if (cursor == global_cursor) {
+            global_cursor = NULL;
+        }
     }
 }