瀏覽代碼

wayland: Fix drag offer leak

The data device leave function is intended for drag offers, not selections, and the function as was previously written was a no-op.

(cherry picked from commit 52efefca0450758848859b67c14fd853e3ddcf4d)
Frank Praznik 2 年之前
父節點
當前提交
2fcbf321fa
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      src/video/wayland/SDL_waylandevents.c

+ 3 - 4
src/video/wayland/SDL_waylandevents.c

@@ -1591,11 +1591,10 @@ static void data_device_handle_enter(void *data, struct wl_data_device *wl_data_
 static void data_device_handle_leave(void *data, struct wl_data_device *wl_data_device)
 static void data_device_handle_leave(void *data, struct wl_data_device *wl_data_device)
 {
 {
     SDL_WaylandDataDevice *data_device = data;
     SDL_WaylandDataDevice *data_device = data;
-    SDL_WaylandDataOffer *offer = NULL;
 
 
-    if (data_device->selection_offer != NULL) {
-        data_device->selection_offer = NULL;
-        Wayland_data_offer_destroy(offer);
+    if (data_device->drag_offer != NULL) {
+        Wayland_data_offer_destroy(data_device->drag_offer);
+        data_device->drag_offer = NULL;
     }
     }
 }
 }