don't crash in wl compositor when data resource is destroyed in multiple listeners

This commit is contained in:
Mike Blumenkrantz 2015-08-10 18:49:04 -04:00
parent 263794f42f
commit 0a690c7d17
1 changed files with 4 additions and 3 deletions

View File

@ -146,7 +146,7 @@ static void
_e_comp_wl_data_device_destroy_selection_data_source(struct wl_listener *listener EINA_UNUSED, void *data) _e_comp_wl_data_device_destroy_selection_data_source(struct wl_listener *listener EINA_UNUSED, void *data)
{ {
E_Comp_Wl_Data_Source *source; E_Comp_Wl_Data_Source *source;
struct wl_resource *data_device_res, *focus = NULL; struct wl_resource *data_device_res = NULL, *focus = NULL;
DBG("Data Device Destroy Selection Source"); DBG("Data Device Destroy Selection Source");
if (!(source = (E_Comp_Wl_Data_Source*)data)) if (!(source = (E_Comp_Wl_Data_Source*)data))
@ -159,8 +159,9 @@ _e_comp_wl_data_device_destroy_selection_data_source(struct wl_listener *listene
if (focus) if (focus)
{ {
data_device_res = if (source->resource)
e_comp_wl_data_find_for_client(wl_resource_get_client(source->resource)); data_device_res =
e_comp_wl_data_find_for_client(wl_resource_get_client(source->resource));
if (data_device_res) if (data_device_res)
wl_data_device_send_selection(data_device_res, NULL); wl_data_device_send_selection(data_device_res, NULL);