Skip to content

Commit

Permalink
wayland: Fix drag offer leak
Browse files Browse the repository at this point in the history
The data device leave function is intended for drag offers, not selections, and the function as was previously written was a no-op.
  • Loading branch information
Kontrabant committed Sep 9, 2023
1 parent 3a992af commit 52efefc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/video/wayland/SDL_waylandevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -1877,11 +1877,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)
{
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;
}
}

Expand Down

0 comments on commit 52efefc

Please sign in to comment.