aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-02-21 11:42:59 +0000
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-02-22 13:18:30 +0000
commit23e81fc937f58e804b815aa6989fc86659388b56 (patch)
tree39141c0417cba43e2e31251c837d213d2599abd3
parent8b82d2ad380a8abfcbf49fd611135e683cc1d733 (diff)
downloadenlightenment-23e81fc937f58e804b815aa6989fc86659388b56.tar.gz
enlightenment-23e81fc937f58e804b815aa6989fc86659388b56.tar.xz
enlightenment-23e81fc937f58e804b815aa6989fc86659388b56.zip
add e_object_ref_debug_set
-rw-r--r--ChangeLog1
-rw-r--r--NEWS1
-rw-r--r--src/bin/e_object.c24
-rw-r--r--src/bin/e_object.h3
4 files changed, 29 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b136784f..ef3077b3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* compositor now allows user changing/remembering of object opacity
* added E_LIST_REVERSE_FREE macro
* E_FN_DEL renamed to E_FREE_FUNC for consistency
+ * added e_object_ref_debug_set
2013-02-20 Mike Blumenkrantz
diff --git a/NEWS b/NEWS
index ca3e00fd3..824ee8c0b 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,7 @@ Additions:
* 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 E_LIST_REVERSE_FREE macro
+ * added e_object_ref_debug_set
Config:
* Added option for disabling icons in menus
* Added option for disabling pointer warping when performing directional focus changes using winlist
diff --git a/src/bin/e_object.c b/src/bin/e_object.c
index 973af2ca6..b8bb78e21 100644
--- a/src/bin/e_object.c
+++ b/src/bin/e_object.c
@@ -44,12 +44,16 @@ e_object_del(E_Object *obj)
if (obj->deleted) return;
if (obj->del_delay_func)
{
+ if (obj->ref_debug)
+ INF("[%p] DELAY DEL (REF: %d)", obj, obj->references);
obj->del_delay_func(obj);
if (!obj->delay_del_job)
obj->delay_del_job = ecore_job_add(_delay_del, obj);
obj->deleted = 1;
return;
}
+ if (obj->ref_debug)
+ INF("[%p] DEL (REF: %d)", obj, obj->references);
obj->deleted = 1;
if (obj->del_att_func) obj->del_att_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);
obj->references++;
+ if (obj->ref_debug)
+ INF("[%p] REF (REF: %d)", obj, obj->references);
return obj->references;
}
@@ -132,6 +138,17 @@ e_object_unref(E_Object *obj)
if (!obj->references) return 0;
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);
return ref;
}
@@ -314,6 +331,13 @@ e_object_del_attach_func_set(E_Object *obj, E_Object_Cleanup_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
e_object_delfn_clear(E_Object *obj)
{
E_Object_Delfn *dfn;
diff --git a/src/bin/e_object.h b/src/bin/e_object.h
index 97a4ebad6..5e2b9fd47 100644
--- a/src/bin/e_object.h
+++ b/src/bin/e_object.h
@@ -68,6 +68,7 @@ struct _E_Object
void *data;
Ecore_Job *delay_del_job;
int walking_list;
+ Eina_Bool ref_debug : 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_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_del (E_Object *obj, char *crumb);