ecore_wl2_dnd: initialize source to NULL when it destroy

Summary:
This prevent double destruction of source. if _ecore_wl2_input_del is called
with destroyed source, it can make unexpected troubles.

Reviewers: Hermet, id213sin, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7265
This commit is contained in:
Yeongjong Lee 2018-11-15 09:11:38 -05:00 committed by Chris Michael
parent 1c530d210d
commit 788507961a
1 changed files with 2 additions and 0 deletions

View File

@ -187,6 +187,7 @@ data_source_cancelled(void *data, struct wl_data_source *source)
Ecore_Wl2_Input *input = data;
if (input->data.drag.source == source) input->data.drag.source = NULL;
if (input->data.selection.source == source) input->data.selection.source = NULL;
input->data.drag.action = WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE;
wl_data_source_destroy(source);
data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_END, 1);
@ -205,6 +206,7 @@ data_source_dnd_finished(void *data, struct wl_data_source *source)
Ecore_Wl2_Input *input = data;
if (input->data.drag.source == source) input->data.drag.source = NULL;
if (input->data.selection.source == source) input->data.selection.source = NULL;
wl_data_source_destroy(source);
data_source_event_emit(input, ECORE_WL2_EVENT_DATA_SOURCE_END, 0);
}