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]: 09e3ea49db
This commit is contained in:
Campbell Barton
2022-10-20 13:51:33 +11:00
parent e2a93e9c7c
commit c58d6b30ad

View File

@@ -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<GWL_Seat *>(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);
}