summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-24 16:19:21 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-24 16:27:18 +0900
commitdee149f3aae2cc44ee5614dbfa0e467ae3237301 (patch)
tree6ca505eadc439e77218b98510b76686e969dce6b
parent7e785d936db96b6c6ff572add0c5eacc1066dd7a (diff)
elm_part: Mark as auto-unref before finalize
This simplifies the IMPLEMENT macro, which can now be a proper function. Also, do not set a parent for the part object, as it's not useful and could mess up the refcount.
-rw-r--r--src/lib/elementary/elm_part_helper.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/elementary/elm_part_helper.h b/src/lib/elementary/elm_part_helper.h
index eef0d2fced..fd07059e60 100644
--- a/src/lib/elementary/elm_part_helper.h
+++ b/src/lib/elementary/elm_part_helper.h
@@ -1,6 +1,9 @@
1#ifndef _ELM_PART_HELPER_H 1#ifndef _ELM_PART_HELPER_H
2#define _ELM_PART_HELPER_H 2#define _ELM_PART_HELPER_H
3 3
4#define EFL_OBJECT_BETA
5#define EFL_OBJECT_PROTECTED
6
4#include "Elementary.h" 7#include "Elementary.h"
5#include "elm_priv.h" 8#include "elm_priv.h"
6#include "efl_ui_layout_part_legacy.eo.h" 9#include "efl_ui_layout_part_legacy.eo.h"
@@ -72,18 +75,19 @@ _elm_part_initialize(Eo *proxy, Eo *obj, const char *part)
72 75
73 EINA_SAFETY_ON_FALSE_RETURN_VAL(pd && obj && part, NULL); 76 EINA_SAFETY_ON_FALSE_RETURN_VAL(pd && obj && part, NULL);
74 efl_allow_parent_unref_set(proxy, 1); 77 efl_allow_parent_unref_set(proxy, 1);
75 // efl_auto_unref_set(proxy, 1); 78 efl_auto_unref_set(proxy, 1);
76 pd->part = eina_tmpstr_add(part); 79 pd->part = eina_tmpstr_add(part);
77 pd->obj = obj; 80 pd->obj = obj;
78 81
79 return proxy; 82 return proxy;
80} 83}
81 84
82#define ELM_PART_IMPLEMENT(PART_CLASS, _obj, _part) ({ \ 85static inline Eo *
83 Eo *proxy = efl_add(PART_CLASS, (Eo *) _obj, \ 86ELM_PART_IMPLEMENT(const Efl_Class *part_klass, const Eo *obj, const char *part)
84 _elm_part_initialize(efl_added, (Eo *) _obj, _part)); \ 87{
85 efl_auto_unref_set(proxy, 1); \ 88 return efl_add(part_klass, NULL,
86 proxy; }) 89 _elm_part_initialize(efl_added, (Eo *) obj, part));
90}
87 91
88#define ELM_PART_OVERRIDE_ONLY_ALIASES(type, TYPE, typedata, aliases) \ 92#define ELM_PART_OVERRIDE_ONLY_ALIASES(type, TYPE, typedata, aliases) \
89 EOLIAN static Efl_Object * \ 93 EOLIAN static Efl_Object * \