gadget: explicitly remove mouse-down callback on shutdown

evas_object_del would clean up the callback as a side effect, but
matching every add with an explicit del avoids relying on that ordering
and keeps the lifetime obvious to readers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-04-29 12:50:24 +07:00
commit c115148f4a

View file

@ -201,6 +201,9 @@ _gc_shutdown(E_Gadcon_Client *gcc)
Instance *inst = gcc->data;
if (!inst) return;
_instances = eina_list_remove(_instances, inst);
if (inst->o_base)
evas_object_event_callback_del_full(inst->o_base, EVAS_CALLBACK_MOUSE_DOWN,
_on_mouse_down, inst);
if (inst->o_icon) evas_object_del(inst->o_icon);
if (inst->o_base) evas_object_del(inst->o_base);
E_FREE(inst);