summaryrefslogtreecommitdiff
path: root/src/lib/evas/gesture
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2018-04-04 14:50:42 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-04-05 11:52:12 -0700
commit53378d6a6bbdd4cf6ae58a2191ab9b815f3b96dd (patch)
treea8b29bd4ce954b2a585638d7d3e628b70e90eb3f /src/lib/evas/gesture
parentdef3bb6eecf7a1d721ac45d9c925df35b234fc0a (diff)
evas: the life cycle of an object inside an hash can not rely on the parent destroying, use ref/unref properly.
Diffstat (limited to 'src/lib/evas/gesture')
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_manager.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.c b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
index ebd40d0..57d1826 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_manager.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
@@ -47,9 +47,9 @@ _cleanup_object(Eina_List *list)
47} 47}
48 48
49static void 49static void
50_hash_free_cb(Eo *obj) 50_hash_unref_cb(Eo *obj)
51{ 51{
52 efl_del(obj); 52 efl_unref(obj);
53} 53}
54 54
55EOLIAN static Efl_Object * 55EOLIAN static Efl_Object *
@@ -57,9 +57,9 @@ _efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_M
57{ 57{
58 obj = efl_constructor(efl_super(obj, MY_CLASS)); 58 obj = efl_constructor(efl_super(obj, MY_CLASS));
59 59
60 pd->m_recognizers = eina_hash_pointer_new(EINA_FREE_CB(_hash_free_cb)); 60 pd->m_recognizers = eina_hash_pointer_new(EINA_FREE_CB(_hash_unref_cb));
61 pd->m_gesture_contex = eina_hash_pointer_new(NULL); 61 pd->m_gesture_contex = eina_hash_pointer_new(NULL);
62 pd->m_object_events = eina_hash_pointer_new(EINA_FREE_CB(_hash_free_cb)); 62 pd->m_object_events = eina_hash_pointer_new(EINA_FREE_CB(_hash_unref_cb));
63 pd->m_object_gestures = NULL; 63 pd->m_object_gestures = NULL;
64 pd->m_gestures_to_delete = NULL; 64 pd->m_gestures_to_delete = NULL;
65 65
@@ -144,7 +144,7 @@ _efl_canvas_gesture_manager_filter_event(Eo *obj, Eo *target, void *event)
144 touch_event = eina_hash_find(pd->m_object_events, &target); 144 touch_event = eina_hash_find(pd->m_object_events, &target);
145 if (!touch_event) 145 if (!touch_event)
146 { 146 {
147 touch_event = efl_add(EFL_CANVAS_GESTURE_TOUCH_CLASS, efl_provider_find(obj, EFL_LOOP_CLASS)); 147 touch_event = efl_add_ref(EFL_CANVAS_GESTURE_TOUCH_CLASS, NULL);
148 eina_hash_add(pd->m_object_events, &target, touch_event); 148 eina_hash_add(pd->m_object_events, &target, touch_event);
149 } 149 }
150 150
@@ -208,7 +208,7 @@ _efl_canvas_gesture_manager_filter_event(Eo *obj, Eo *target, void *event)
208 208
209EOLIAN static const Efl_Event_Description * 209EOLIAN static const Efl_Event_Description *
210_efl_canvas_gesture_manager_recognizer_register(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Manager_Data *pd, 210_efl_canvas_gesture_manager_recognizer_register(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Manager_Data *pd,
211 Efl_Canvas_Gesture_Recognizer *recognizer) 211 Efl_Canvas_Gesture_Recognizer *recognizer)
212{ 212{
213 Efl_Canvas_Gesture_Recognizer_Data *rpd; 213 Efl_Canvas_Gesture_Recognizer_Data *rpd;
214 Efl_Canvas_Gesture *dummy = efl_gesture_recognizer_create(recognizer, 0); 214 Efl_Canvas_Gesture *dummy = efl_gesture_recognizer_create(recognizer, 0);
@@ -219,7 +219,7 @@ _efl_canvas_gesture_manager_recognizer_register(Eo *obj EINA_UNUSED, Efl_Canvas_
219 const Efl_Event_Description *type = efl_gesture_type_get(dummy); 219 const Efl_Event_Description *type = efl_gesture_type_get(dummy);
220 220
221 // Add the recognizer to the m_recognizers 221 // Add the recognizer to the m_recognizers
222 eina_hash_add(pd->m_recognizers, &type, recognizer); 222 eina_hash_add(pd->m_recognizers, &type, efl_ref(recognizer));
223 // update the manager 223 // update the manager
224 rpd = efl_data_scope_get(recognizer, EFL_CANVAS_GESTURE_RECOGNIZER_CLASS); 224 rpd = efl_data_scope_get(recognizer, EFL_CANVAS_GESTURE_RECOGNIZER_CLASS);
225 rpd->manager = obj; 225 rpd->manager = obj;