summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-01-29 13:09:36 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-02-05 10:10:54 +0100
commit02b721078afd4b5683e1d76ad33bf0d451f13d67 (patch)
treea42e3a3f69197b3f08556e1d9997ac7aa143c2c8 /src/lib/evas
parentd8ed195916f5ac31075e17481a9808eb7bc1b1d8 (diff)
efl/gesture: fix gesture object cleanup when unregistering a recognizer
these objects need to be cleaned up immediately outside of event processing to avoid having them automatically deleted later on and triggering a double delete Differential Revision: https://phab.enlightenment.org/D11240
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_manager.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.c b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
index 180cddb2be..c5fc151390 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_manager.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
@@ -28,6 +28,7 @@ typedef struct _Efl_Canvas_Gesture_Manager_Data
28 Eina_List *m_gestures_to_delete; 28 Eina_List *m_gestures_to_delete;
29 //Kepps config values for gesture recognize 29 //Kepps config values for gesture recognize
30 Eina_Hash *m_config; 30 Eina_Hash *m_config;
31 Eina_Bool processing : 1;
31} Efl_Canvas_Gesture_Manager_Data; 32} Efl_Canvas_Gesture_Manager_Data;
32 33
33static void _cleanup_cached_gestures(Efl_Canvas_Gesture_Manager_Data *pd, 34static void _cleanup_cached_gestures(Efl_Canvas_Gesture_Manager_Data *pd,
@@ -326,6 +327,7 @@ _efl_canvas_gesture_manager_filter_event(void *data, Eo *target, void *event)
326 327
327 thisisreallystupid = eina_hash_find(pd->m_gesture_contex, &target); 328 thisisreallystupid = eina_hash_find(pd->m_gesture_contex, &target);
328 if (!thisisreallystupid) return; 329 if (!thisisreallystupid) return;
330 pd->processing = EINA_TRUE;
329 it = eina_hash_iterator_tuple_new(thisisreallystupid); 331 it = eina_hash_iterator_tuple_new(thisisreallystupid);
330 EINA_ITERATOR_FOREACH(it, tup) 332 EINA_ITERATOR_FOREACH(it, tup)
331 { 333 {
@@ -344,6 +346,7 @@ _efl_canvas_gesture_manager_filter_event(void *data, Eo *target, void *event)
344 } 346 }
345 } 347 }
346 eina_iterator_free(it); 348 eina_iterator_free(it);
349 pd->processing = EINA_FALSE;
347} 350}
348 351
349EOLIAN static void 352EOLIAN static void
@@ -413,6 +416,9 @@ _efl_canvas_gesture_manager_recognizer_unregister(Eo *obj EINA_UNUSED, Efl_Canva
413 pd->m_object_gestures = eina_list_remove_list(pd->m_object_gestures, l); 416 pd->m_object_gestures = eina_list_remove_list(pd->m_object_gestures, l);
414 } 417 }
415 } 418 }
419 if (pd->processing) return;
420 _cleanup_object(pd->m_gestures_to_delete);
421 pd->m_gestures_to_delete = NULL;
416} 422}
417 423
418// EOLIAN static void 424// EOLIAN static void