diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2017-01-27 10:52:32 -0500 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2017-01-27 10:51:21 -0500 |
commit | 1861f474e4c783fee9f9a3d50764891a67bfc3a5 (patch) | |
tree | 73dd9f8b52e5ff3adac4214dc2fa154ac2567149 | |
parent | acf8988c40694c3c8b99f3f113baab73efd22c48 (diff) | |
download | enlightenment-1861f474e4c783fee9f9a3d50764891a67bfc3a5.tar.gz |
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.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bin/e_gadget.c b/src/bin/e_gadget.c index ebd1a6c9cc..c24fbf03b7 100644 --- a/src/bin/e_gadget.c +++ b/src/bin/e_gadget.c @@ -123,6 +123,7 @@ static E_Config_DD *edd_gadget; static void _gadget_object_finalize(E_Gadget_Config *zgc); static Eina_Bool _gadget_object_create(E_Gadget_Config *zgc); static void _editor_pointer_site_init(E_Gadget_Site_Orient orient, Evas_Object *site, Evas_Object *editor, Eina_Bool ); +static void _gadget_drop_handler_moveresize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED); static void _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) } zgc->gadget = NULL; + if (zgc->drop_handlers) + { + Evas_Object *drop_object; + Eina_Iterator *it = eina_hash_iterator_key_new(zgc->drop_handlers); + + EINA_ITERATOR_FOREACH(it, drop_object) + { + evas_object_event_callback_del(drop_object, EVAS_CALLBACK_MOVE, _gadget_drop_handler_moveresize); + evas_object_event_callback_del(drop_object, EVAS_CALLBACK_RESIZE, _gadget_drop_handler_moveresize); + evas_object_event_callback_del(drop_object, EVAS_CALLBACK_DEL, _gadget_drop_handler_del); + } + eina_iterator_free(it); + } + E_FREE_FUNC(zgc->drop_handlers, eina_hash_free); E_FREE_FUNC(zgc->gadget, evas_object_del); E_FREE_FUNC(zgc->cfg_object, evas_object_del); |