xwayland/selection: destroy all selections on Xwayland restart

Previously, Xwayland could restart, and we'd get events for transfers
pointing to the previous (now freed) xwm instance. This led to
use-after-free segfaults.

Closes #2565.
This commit is contained in:
Tudor Brindus 2021-01-29 19:00:17 -05:00 committed by Simon Ser
parent 3417fc0cca
commit b6ba595862
3 changed files with 28 additions and 3 deletions

View file

@ -66,7 +66,7 @@ static struct wlr_xwm_selection_transfer *xwm_selection_transfer_get_first(
return first;
}
static void xwm_selection_transfer_destroy_outgoing(
void xwm_selection_transfer_destroy_outgoing(
struct wlr_xwm_selection_transfer *transfer) {
struct wlr_xwm_selection *selection = transfer->selection;
bool was_first = transfer == xwm_selection_transfer_get_first(selection);