forked from enlightenment/efl
ecore_wl2: Prevent use after free on input deletion
Window structs keep inputs around, so we should sweep through them and NULL out any stale ones on a delete.
This commit is contained in:
parent
8328d4db89
commit
120063ad76
|
@ -1443,6 +1443,7 @@ _ecore_wl2_input_del(Ecore_Wl2_Input *input)
|
|||
Ecore_Wl2_Display *display;
|
||||
Eina_Inlist *l = NULL;
|
||||
Ecore_Wl2_Mouse_Down_Info *info = NULL;
|
||||
Ecore_Wl2_Window *window;
|
||||
|
||||
if (!input) return;
|
||||
|
||||
|
@ -1490,6 +1491,9 @@ _ecore_wl2_input_del(Ecore_Wl2_Input *input)
|
|||
display->inputs =
|
||||
eina_inlist_remove(display->inputs, EINA_INLIST_GET(input));
|
||||
|
||||
EINA_INLIST_FOREACH(display->windows, window)
|
||||
if (window->input == input) window->input = NULL;
|
||||
|
||||
free(input);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue