summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-01-27 10:52:32 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-01-27 10:51:21 -0500
commit1861f474e4c783fee9f9a3d50764891a67bfc3a5 (patch)
tree73dd9f8b52e5ff3adac4214dc2fa154ac2567149
parentacf8988c40694c3c8b99f3f113baab73efd22c48 (diff)
remove gadget drop object event callbacks during object deletion
ensure that no callbacks reference gadget internals after they have been deleted
-rw-r--r--src/bin/e_gadget.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bin/e_gadget.c b/src/bin/e_gadget.c
index ebd1a6c9c..c24fbf03b 100644
--- a/src/bin/e_gadget.c
+++ b/src/bin/e_gadget.c
@@ -123,6 +123,7 @@ static E_Config_DD *edd_gadget;
123static void _gadget_object_finalize(E_Gadget_Config *zgc); 123static void _gadget_object_finalize(E_Gadget_Config *zgc);
124static Eina_Bool _gadget_object_create(E_Gadget_Config *zgc); 124static Eina_Bool _gadget_object_create(E_Gadget_Config *zgc);
125static void _editor_pointer_site_init(E_Gadget_Site_Orient orient, Evas_Object *site, Evas_Object *editor, Eina_Bool ); 125static void _editor_pointer_site_init(E_Gadget_Site_Orient orient, Evas_Object *site, Evas_Object *editor, Eina_Bool );
126static void _gadget_drop_handler_moveresize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED);
126 127
127static void 128static void
128_comp_site_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 129_comp_site_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
@@ -297,6 +298,20 @@ _gadget_object_free(E_Object *eobj)
297 } 298 }
298 zgc->gadget = NULL; 299 zgc->gadget = NULL;
299 300
301 if (zgc->drop_handlers)
302 {
303 Evas_Object *drop_object;
304 Eina_Iterator *it = eina_hash_iterator_key_new(zgc->drop_handlers);
305
306 EINA_ITERATOR_FOREACH(it, drop_object)
307 {
308 evas_object_event_callback_del(drop_object, EVAS_CALLBACK_MOVE, _gadget_drop_handler_moveresize);
309 evas_object_event_callback_del(drop_object, EVAS_CALLBACK_RESIZE, _gadget_drop_handler_moveresize);
310 evas_object_event_callback_del(drop_object, EVAS_CALLBACK_DEL, _gadget_drop_handler_del);
311 }
312 eina_iterator_free(it);
313 }
314
300 E_FREE_FUNC(zgc->drop_handlers, eina_hash_free); 315 E_FREE_FUNC(zgc->drop_handlers, eina_hash_free);
301 E_FREE_FUNC(zgc->gadget, evas_object_del); 316 E_FREE_FUNC(zgc->gadget, evas_object_del);
302 E_FREE_FUNC(zgc->cfg_object, evas_object_del); 317 E_FREE_FUNC(zgc->cfg_object, evas_object_del);