From c58d6b30add69fc3c6004d2ad2a590d7d44cc83b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 20 Oct 2022 13:51:33 +1100 Subject: GHOST/Wayland: correct assert from recent commit Error in [0], only clear the stored clipboard data source pointer if it matches the data being cleared. [0]: 09e3ea49dbbec15a8fcc79cc609f6dc8c13bc91f --- intern/ghost/intern/GHOST_SystemWayland.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp index 5c3f807d678..4b3f3ec5ef2 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cpp +++ b/intern/ghost/intern/GHOST_SystemWayland.cpp @@ -1284,8 +1284,9 @@ static void data_source_handle_cancelled(void *data, struct wl_data_source *wl_d CLOG_INFO(LOG, 2, "cancelled"); GWL_Seat *seat = static_cast(data); GWL_DataSource *data_source = seat->data_source; - GHOST_ASSERT(seat->data_source->wl_data_source == wl_data_source, "Data source mismatch!"); - data_source->wl_data_source = nullptr; + if (seat->data_source->wl_data_source == wl_data_source) { + data_source->wl_data_source = nullptr; + } wl_data_source_destroy(wl_data_source); } -- cgit v1.2.3