Elm: fix the widget event callback freeing

Removes the event callback list within _smart_del. The current
implementation does not care about the node data resulting on
memory leaks.

Here follows the valgrind log:

16 bytes in 1 blocks are definitely lost in loss record 11 of 168
at 0x4C29DB4: calloc (in
        /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
        by 0x522EC34: elm_widget_event_callback_add (elm_widget.c:1996)
        by 0x5A7AA2B: _edje_emit_handle (edje_program.c:1322)
        by 0x5A766B6: _edje_message_queue_process (edje_message_queue.c:764)
        by 0x5A76856: _edje_job (edje_message_queue.c:160)
        by 0x628C02A: _ecore_job_event_handler (ecore_job.c:115)
        by 0x6288C1F: _ecore_event_call (ecore_private.h:319)
        by 0x628D09B: _ecore_main_loop_iterate_internal (ecore_main.c:1814)
        by 0x628D566: ecore_main_loop_begin (ecore_main.c:931)
        by 0x4023B0: elm_main (test.c:198)

Patch by Leandro Dorileo <dorileo@profusion.mobi>



SVN revision: 72498
This commit is contained in:
Bruno Dilly 2012-06-19 18:20:38 +00:00
parent a7cacf4204
commit 04061fc239
1 changed files with 5 additions and 1 deletions

View File

@ -4715,6 +4715,7 @@ _smart_del(Evas_Object *obj)
{
Evas_Object *sobj;
Elm_Translate_String_Data *ts;
Elm_Event_Cb_Data *ecb;
ELM_WIDGET_DATA_GET(obj, sd);
@ -4756,7 +4757,10 @@ _smart_del(Evas_Object *obj)
eina_stringshare_del(ts->string);
free(ts);
}
sd->event_cb = eina_list_free(sd->event_cb); /* should be empty anyway */
EINA_LIST_FREE(sd->event_cb, ecb)
free(ecb);
if (sd->style) eina_stringshare_del(sd->style);
if (sd->theme) elm_theme_free(sd->theme);
_if_focused_revert(obj, EINA_TRUE);