summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2014-09-30 14:27:43 +0100
committerTom Hacohen <tom@stosb.com>2014-09-30 14:27:43 +0100
commit08ccaf5740b17ea632554360e7fd64c9d543ea5c (patch)
tree557cefff93ac10965ebe30ad002d2440941c316e
parenta4d716d1c0ea5470f319413d82e915798ce9600e (diff)
-rw-r--r--src/lib/eo/eo.c9
-rw-r--r--src/lib/eo/eo_private.h10
2 files changed, 8 insertions, 11 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index fa64ce135f..e78b6f0f24 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -1546,7 +1546,14 @@ eo_unref(const Eo *obj_id)
1546EAPI void 1546EAPI void
1547eo_del(const Eo *obj) 1547eo_del(const Eo *obj)
1548{ 1548{
1549 eo_unref(obj); 1549 if (eo_do(obj, eo_parent_get()))
1550 {
1551 eo_do(obj, eo_parent_set(NULL));
1552 }
1553 else
1554 {
1555 eo_unref(obj);
1556 }
1550} 1557}
1551 1558
1552EAPI int 1559EAPI int
diff --git a/src/lib/eo/eo_private.h b/src/lib/eo/eo_private.h
index 1c21d2255e..be0a03a09d 100644
--- a/src/lib/eo/eo_private.h
+++ b/src/lib/eo/eo_private.h
@@ -284,16 +284,6 @@ _eo_unref(_Eo_Object *obj)
284 return; 284 return;
285 } 285 }
286 286
287 /* Unparent if parented. */
288 {
289 Eo *eo_id = _eo_id_get(obj);
290 obj->refcount = 2; /* Needs to be high enough that parent set to null won't delete the object. */
291
292 eo_do(eo_id, eo_parent_set(NULL));
293
294 obj->refcount = 0;
295 }
296
297 _eo_del_internal(__FILE__, __LINE__, obj); 287 _eo_del_internal(__FILE__, __LINE__, obj);
298 288
299#ifdef EO_DEBUG 289#ifdef EO_DEBUG