data-device: fix use-after-free on drop

This commit is contained in:
emersion 2019-01-29 22:40:10 +01:00
parent a37dfb380b
commit c505ce3019
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -174,7 +174,9 @@ static uint32_t drag_handle_pointer_button(struct wlr_seat_pointer_grab *grab,
}; };
wlr_signal_emit_safe(&drag->events.drop, &event); wlr_signal_emit_safe(&drag->events.drop, &event);
} else if (drag->source->impl->dnd_finish) { } else if (drag->source->impl->dnd_finish) {
// This will end the grab and free `drag`
wlr_data_source_destroy(drag->source); wlr_data_source_destroy(drag->source);
return 0;
} }
} }