actually fix evas event cb leak for good. work ast smart desc leak.

SVN revision: 47552
This commit is contained in:
Carsten Haitzler 2010-03-29 05:03:25 +00:00
parent 46e1d8a866
commit 5f309b5d9f
4 changed files with 17 additions and 3 deletions

View File

@ -19,7 +19,7 @@ evas_event_callback_list_post_free(Eina_Inlist **list)
l = l->next;
if (fn->delete_me)
{
*list = eina_inlist_remove(*list, EINA_INLIST_GET(fn));
*list = eina_inlist_remove(*list, EINA_INLIST_GET(fn));
free(fn);
}
}
@ -73,6 +73,16 @@ evas_object_event_callback_cleanup(Evas_Object *obj)
obj->callbacks = NULL;
}
void
evas_event_callback_all_del(Evas *e)
{
Evas_Func_Node *fn;
if (!e->callbacks) return;
EINA_INLIST_FOREACH(e->callbacks->callbacks, fn)
fn->delete_me = 1;
}
void
evas_event_callback_cleanup(Evas *e)
{

View File

@ -239,6 +239,7 @@ evas_free(Evas *e)
evas_fonts_zero_free(e);
evas_event_callback_all_del(e);
evas_event_callback_cleanup(e);
if (e->engine.func)

View File

@ -113,6 +113,7 @@ evas_smart_free(Evas_Smart *s)
s->delete_me = 1;
if (s->usage > 0) return;
if (s->class_allocated) free((void *)s->smart_class);
free(s->callbacks.array);
free(s);
}
@ -340,7 +341,8 @@ evas_smart_cb_descriptions_resize(Evas_Smart_Cb_Description_Array *a, unsigned i
static int
_evas_smart_cb_description_cmp_sort(const void *p1, const void *p2)
{
const Evas_Smart_Cb_Description * const*a = p1, * const*b = p2;
const Evas_Smart_Cb_Description **a = (const Evas_Smart_Cb_Description **)p1;
const Evas_Smart_Cb_Description **b = (const Evas_Smart_Cb_Description **)p2;
return strcmp((*a)->name, (*b)->name);
}
@ -415,7 +417,7 @@ static int
_evas_smart_cb_description_cmp_search(const void *p1, const void *p2)
{
const char *name = p1;
const Evas_Smart_Cb_Description * const*v = p2;
const Evas_Smart_Cb_Description **v = (const Evas_Smart_Cb_Description **)p2;
/* speed up string shares searches (same pointers) */
if (name == (*v)->name) return 0;
return strcmp(name, (*v)->name);

View File

@ -792,6 +792,7 @@ void *evas_mem_calloc(int size);
void evas_event_callback_list_post_free(Eina_Inlist **list);
void evas_object_event_callback_all_del(Evas_Object *obj);
void evas_object_event_callback_cleanup(Evas_Object *obj);
void evas_event_callback_all_del(Evas *e);
void evas_event_callback_cleanup(Evas *e);
void evas_object_inform_call_show(Evas_Object *obj);
void evas_object_inform_call_hide(Evas_Object *obj);