forked from enlightenment/enlightenment
add e_object_ref_debug_set
This commit is contained in:
parent
8b82d2ad38
commit
23e81fc937
|
@ -3,6 +3,7 @@
|
||||||
* compositor now allows user changing/remembering of object opacity
|
* compositor now allows user changing/remembering of object opacity
|
||||||
* added E_LIST_REVERSE_FREE macro
|
* added E_LIST_REVERSE_FREE macro
|
||||||
* E_FN_DEL renamed to E_FREE_FUNC for consistency
|
* E_FN_DEL renamed to E_FREE_FUNC for consistency
|
||||||
|
* added e_object_ref_debug_set
|
||||||
|
|
||||||
2013-02-20 Mike Blumenkrantz
|
2013-02-20 Mike Blumenkrantz
|
||||||
|
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -31,6 +31,7 @@ Additions:
|
||||||
* added e_layout functions for returning objects above or below a layout child
|
* added e_layout functions for returning objects above or below a layout child
|
||||||
* added functions for noting objects which are part of a popup
|
* added functions for noting objects which are part of a popup
|
||||||
* added E_LIST_REVERSE_FREE macro
|
* added E_LIST_REVERSE_FREE macro
|
||||||
|
* added e_object_ref_debug_set
|
||||||
Config:
|
Config:
|
||||||
* Added option for disabling icons in menus
|
* Added option for disabling icons in menus
|
||||||
* Added option for disabling pointer warping when performing directional focus changes using winlist
|
* Added option for disabling pointer warping when performing directional focus changes using winlist
|
||||||
|
|
|
@ -44,12 +44,16 @@ e_object_del(E_Object *obj)
|
||||||
if (obj->deleted) return;
|
if (obj->deleted) return;
|
||||||
if (obj->del_delay_func)
|
if (obj->del_delay_func)
|
||||||
{
|
{
|
||||||
|
if (obj->ref_debug)
|
||||||
|
INF("[%p] DELAY DEL (REF: %d)", obj, obj->references);
|
||||||
obj->del_delay_func(obj);
|
obj->del_delay_func(obj);
|
||||||
if (!obj->delay_del_job)
|
if (!obj->delay_del_job)
|
||||||
obj->delay_del_job = ecore_job_add(_delay_del, obj);
|
obj->delay_del_job = ecore_job_add(_delay_del, obj);
|
||||||
obj->deleted = 1;
|
obj->deleted = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (obj->ref_debug)
|
||||||
|
INF("[%p] DEL (REF: %d)", obj, obj->references);
|
||||||
obj->deleted = 1;
|
obj->deleted = 1;
|
||||||
if (obj->del_att_func) obj->del_att_func(obj);
|
if (obj->del_att_func) obj->del_att_func(obj);
|
||||||
if (obj->del_func) obj->del_func(obj);
|
if (obj->del_func) obj->del_func(obj);
|
||||||
|
@ -120,6 +124,8 @@ e_object_ref(E_Object *obj)
|
||||||
{
|
{
|
||||||
E_OBJECT_CHECK_RETURN(obj, -1);
|
E_OBJECT_CHECK_RETURN(obj, -1);
|
||||||
obj->references++;
|
obj->references++;
|
||||||
|
if (obj->ref_debug)
|
||||||
|
INF("[%p] REF (REF: %d)", obj, obj->references);
|
||||||
return obj->references;
|
return obj->references;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,6 +138,17 @@ e_object_unref(E_Object *obj)
|
||||||
if (!obj->references) return 0;
|
if (!obj->references) return 0;
|
||||||
obj->references--;
|
obj->references--;
|
||||||
ref = obj->references;
|
ref = obj->references;
|
||||||
|
if (obj->ref_debug)
|
||||||
|
{
|
||||||
|
if ((ref > 1) && (ref < 1000))
|
||||||
|
INF("[%p] UNREF (REF: %d)", obj, ref);
|
||||||
|
else if (ref == 1)
|
||||||
|
INF("[%p] UNREF (REF: %d)", obj, ref);
|
||||||
|
else if (!ref)
|
||||||
|
INF("[%p] UNREF (REF: %d)", obj, ref);
|
||||||
|
else
|
||||||
|
CRI("[%p] UNREF (REF: %d)", obj, ref);
|
||||||
|
}
|
||||||
if (obj->references == 0) e_object_free(obj);
|
if (obj->references == 0) e_object_free(obj);
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
@ -313,6 +330,13 @@ e_object_del_attach_func_set(E_Object *obj, E_Object_Cleanup_Func func)
|
||||||
obj->del_att_func = func;
|
obj->del_att_func = func;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
e_object_ref_debug_set(E_Object *obj, Eina_Bool set)
|
||||||
|
{
|
||||||
|
E_OBJECT_CHECK(obj);
|
||||||
|
obj->ref_debug = !!set;
|
||||||
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
e_object_delfn_clear(E_Object *obj)
|
e_object_delfn_clear(E_Object *obj)
|
||||||
{
|
{
|
||||||
|
|
|
@ -68,6 +68,7 @@ struct _E_Object
|
||||||
void *data;
|
void *data;
|
||||||
Ecore_Job *delay_del_job;
|
Ecore_Job *delay_del_job;
|
||||||
int walking_list;
|
int walking_list;
|
||||||
|
Eina_Bool ref_debug : 1;
|
||||||
Eina_Bool deleted : 1;
|
Eina_Bool deleted : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -100,6 +101,8 @@ EAPI E_Object_Delfn *e_object_delfn_add (E_Object *obj, void (*func) (void *data
|
||||||
EAPI void e_object_delfn_del (E_Object *obj, E_Object_Delfn *dfn);
|
EAPI void e_object_delfn_del (E_Object *obj, E_Object_Delfn *dfn);
|
||||||
EAPI void e_object_delfn_clear(E_Object *obj);
|
EAPI void e_object_delfn_clear(E_Object *obj);
|
||||||
|
|
||||||
|
EAPI void e_object_ref_debug_set(E_Object *obj, Eina_Bool set);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
EAPI void e_object_breadcrumb_add (E_Object *obj, char *crumb);
|
EAPI void e_object_breadcrumb_add (E_Object *obj, char *crumb);
|
||||||
EAPI void e_object_breadcrumb_del (E_Object *obj, char *crumb);
|
EAPI void e_object_breadcrumb_del (E_Object *obj, char *crumb);
|
||||||
|
|
Loading…
Reference in New Issue