Browse Source

Fixed crash getting clipboard data processing clipboard events on X11

SDL_PumpEvents() was freeing the temporary memory in the clipboard event, so if the application was iterating over the mime types in the event and retrieving the clipboard data, it would crash after the first entry.
Sam Lantinga 2 days ago
parent
commit
3c0a6c32d4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/video/x11/SDL_x11clipboard.c

+ 1 - 1
src/video/x11/SDL_x11clipboard.c

@@ -139,7 +139,7 @@ static bool WaitForSelection(SDL_VideoDevice *_this, Atom selection_type, bool *
     waitStart = SDL_GetTicks();
     waitStart = SDL_GetTicks();
     *flag = true;
     *flag = true;
     while (*flag) {
     while (*flag) {
-        SDL_PumpEvents();
+        X11_PumpEvents(_this);
         waitElapsed = SDL_GetTicks() - waitStart;
         waitElapsed = SDL_GetTicks() - waitStart;
         // Wait one second for a selection response.
         // Wait one second for a selection response.
         if (waitElapsed > 1000) {
         if (waitElapsed > 1000) {