summaryrefslogtreecommitdiff
path: root/src/lib/eo
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-05-03 16:32:11 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-24 16:02:18 -0700
commitc28eb28728c280d3fd19ef46790fce6f9465d4f5 (patch)
tree6fef85cdb252d7ead743d13564ff11aaa2ac6805 /src/lib/eo
parentdcfddcd283e01e36096d573af9b46f512a39272c (diff)
eo: check for allow_parent_unref during efl_unref and silence warning.
Differential Revision: https://phab.enlightenment.org/D6097
Diffstat (limited to 'src/lib/eo')
-rw-r--r--src/lib/eo/eo.c3
-rw-r--r--src/lib/eo/eo_base_class.c10
-rw-r--r--src/lib/eo/eo_private.h1
3 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 558ee29..9be954f 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -1885,7 +1885,8 @@ efl_unref(const Eo *obj_id)
1885 if (EINA_UNLIKELY(obj->user_refcount == 1 && 1885 if (EINA_UNLIKELY(obj->user_refcount == 1 &&
1886 obj->parent)) 1886 obj->parent))
1887 { 1887 {
1888 CRI("Calling efl_unref instead of efl_del or efl_parent_set(NULL). Temporary fallback in place triggered."); 1888 if (!obj->allow_parent_unref)
1889 CRI("Calling efl_unref instead of efl_del or efl_parent_set(NULL). Temporary fallback in place triggered.");
1889 EO_OBJ_DONE(obj_id); 1890 EO_OBJ_DONE(obj_id);
1890 efl_del(obj_id); 1891 efl_del(obj_id);
1891 return ; 1892 return ;
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 72aa678..d184265 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -5,7 +5,10 @@
5#include <Eina.h> 5#include <Eina.h>
6#include <fnmatch.h> 6#include <fnmatch.h>
7 7
8#include "Eo.h" 8#include <Eo.h>
9
10#include "eo_internal.h"
11
9#include "eo_ptr_indirection.h" 12#include "eo_ptr_indirection.h"
10#include "eo_private.h" 13#include "eo_private.h"
11#include "eina_promise_private.h" 14#include "eina_promise_private.h"
@@ -2212,9 +2215,12 @@ err_parent:
2212} 2215}
2213 2216
2214EOLIAN static void 2217EOLIAN static void
2215_efl_object_allow_parent_unref_set(Eo *obj_id EINA_UNUSED, Efl_Object_Data *pd, Eina_Bool allow) 2218_efl_object_allow_parent_unref_set(Eo *obj_id, Efl_Object_Data *pd, Eina_Bool allow)
2216{ 2219{
2220 EO_OBJ_POINTER_RETURN(obj_id, obj);
2221 obj->allow_parent_unref = !!allow;
2217 pd->allow_parent_unref = !!allow; 2222 pd->allow_parent_unref = !!allow;
2223 EO_OBJ_DONE(obj_id);
2218} 2224}
2219 2225
2220EOLIAN static Eina_Bool 2226EOLIAN static Eina_Bool
diff --git a/src/lib/eo/eo_private.h b/src/lib/eo/eo_private.h
index 94882ef..96e7b7f 100644
--- a/src/lib/eo/eo_private.h
+++ b/src/lib/eo/eo_private.h
@@ -118,6 +118,7 @@ struct _Eo_Object
118 Eina_Bool invalidate:1; 118 Eina_Bool invalidate:1;
119 Eina_Bool is_invalidating:1; 119 Eina_Bool is_invalidating:1;
120 Eina_Bool parent : 1; 120 Eina_Bool parent : 1;
121 Eina_Bool allow_parent_unref : 1;
121 122
122 Eina_Bool del_triggered:1; 123 Eina_Bool del_triggered:1;
123 Eina_Bool destructed:1; 124 Eina_Bool destructed:1;