xwayland/selection: concurrent (?) clipboard manipulation causes wm->property_source to already be NULL
When using the clipboard in neovim (which uses xclip
— and I think asynchronously), especially when mashing dd
rapidly to delete (cut into the clipboard) several lines, Weston often crashes.
This is because wm->property_source
is already NULL when it gets passed into wl_event_source_remove
.
The crash was mostly happening on line 373 (under if (len == -1)
).
I've added a null check there, and now it crashes less often, but it just crashed on me on line 419 (else if (len == 0 && !wm->incr)
).