diff --git a/gdk/wayland/gdkselection-wayland.c b/gdk/wayland/gdkselection-wayland.c index b675437951..0dd3aa9ebf 100644 --- a/gdk/wayland/gdkselection-wayland.c +++ b/gdk/wayland/gdkselection-wayland.c @@ -860,7 +860,14 @@ gdk_wayland_selection_store (GdkWindow *window, } stored_selection_add_data (stored_selection, mode, data, len); - stored_selection_notify_write (stored_selection); + + if (stored_selection->data) + stored_selection_notify_write (stored_selection); + else + { + g_ptr_array_remove_fast (selection->stored_selections, + stored_selection); + } /* Handle the next GDK_SELECTION_REQUEST / store, if any */ selection->current_request_selection = GDK_NONE;