summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-24 16:15:03 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-24 16:15:44 +0900
commit7e785d936db96b6c6ff572add0c5eacc1066dd7a (patch)
tree27213bf5db507c051b998d9753f21b1c6912d5b4
parent8608e8dc7047bfe074a71e638bc44b0eec198827 (diff)
eo: Make sure auto_unref only applies after finalize
It would be pretty stupid to create an object that dies before it even gets created. Auto-unref is for parts and should probably not be used anywhere else :)
-rw-r--r--src/lib/eo/eo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 17595e0..8365807 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -621,7 +621,7 @@ err:
621 { 621 {
622 if (EINA_UNLIKELY(obj->auto_unref != 0)) 622 if (EINA_UNLIKELY(obj->auto_unref != 0))
623 { 623 {
624 if (!(--obj->auto_unref)) 624 if (obj->finalized && !(--obj->auto_unref))
625 efl_unref(eo_id); 625 efl_unref(eo_id);
626 } 626 }
627 _efl_unref(obj); 627 _efl_unref(obj);
@@ -680,7 +680,7 @@ _efl_object_call_end(Efl_Object_Op_Call_Data *call)
680 { 680 {
681 if (EINA_UNLIKELY(call->obj->auto_unref != 0)) 681 if (EINA_UNLIKELY(call->obj->auto_unref != 0))
682 { 682 {
683 if (!(--call->obj->auto_unref)) 683 if (call->obj->finalized && !(--call->obj->auto_unref))
684 efl_unref(call->eo_id); 684 efl_unref(call->eo_id);
685 } 685 }
686 _efl_unref(call->obj); 686 _efl_unref(call->obj);
@@ -750,7 +750,7 @@ _efl_object_op_api_id_get(const void *api_func, const Eo *eo_obj, const char *ap
750 "Unable to resolve op for api func %p for obj=%p (%s)", api_func, eo_obj, efl_class_name_get(eo_obj)); 750 "Unable to resolve op for api func %p for obj=%p (%s)", api_func, eo_obj, efl_class_name_get(eo_obj));
751 if (EINA_UNLIKELY(obj->auto_unref)) 751 if (EINA_UNLIKELY(obj->auto_unref))
752 { 752 {
753 if (!(--obj->auto_unref)) 753 if (obj->finalized && !(--obj->auto_unref))
754 efl_unref(eo_obj); 754 efl_unref(eo_obj);
755 } 755 }
756 return EFL_NOOP; 756 return EFL_NOOP;