summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortasn <tasn>2012-09-12 11:31:58 +0000
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2012-09-12 11:31:58 +0000
commit107ad90c6c8f7dd9d9330a2c8ffbd9109331bc07 (patch)
tree978749552273d5648307f7bb01a4b930a62871d6 /src/lib
parenta7832bc0030a0ad2278823b7bcdff7a105d7c5c9 (diff)
downloadeobj-107ad90c6c8f7dd9d9330a2c8ffbd9109331bc07.tar.gz
eobj-107ad90c6c8f7dd9d9330a2c8ffbd9109331bc07.tar.bz2
eobj-107ad90c6c8f7dd9d9330a2c8ffbd9109331bc07.zip
Eo: Added eo_destructed_is.
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/PROTO/eobj@76518 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Eo.h11
-rw-r--r--src/lib/eo.c8
2 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/Eo.h b/src/lib/Eo.h
index 08f0a1a..ffb46fb 100644
--- a/src/lib/Eo.h
+++ b/src/lib/Eo.h
@@ -744,6 +744,17 @@ EAPI void eo_manual_free_set(Eo *obj, Eina_Bool manual_free);
EAPI void eo_manual_free(Eo *obj);
/**
+ * @brief Checks if the object was already descructed (only relevant for manual_free objects).
+ * @param obj the object to check.
+ * This function checks if the object was already destructed (but not alraedy
+ * freed). It should only be used with objects that are supposed to be manually
+ * freed, but not yet freed (but possibly destructed).
+ *
+ * @see eo_manual_free_set()
+ */
+EAPI Eina_Bool eo_destructed_is(const Eo *obj);
+
+/**
* @addtogroup Eo_Composite_Objects Composite Objects.
* @{
*/
diff --git a/src/lib/eo.c b/src/lib/eo.c
index 59e11f3..9eaba3d 100644
--- a/src/lib/eo.c
+++ b/src/lib/eo.c
@@ -1545,6 +1545,14 @@ eo_composite_is(const Eo *comp_obj)
return comp_obj->composite;
}
+EAPI Eina_Bool
+eo_destructed_is(const Eo *obj)
+{
+ EO_MAGIC_RETURN_VAL(obj, EO_EINA_MAGIC, EINA_FALSE);
+
+ return obj->del;
+}
+
EAPI void
eo_manual_free_set(Eo *obj, Eina_Bool manual_free)
{