summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-09-25 17:27:23 -0700
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-09-25 17:27:23 -0700
commit09a1e75dcbc9593a8240ebe233841bc65d1e5f28 (patch)
tree5cfd98eddb5e83ad2c06194f71394fb1e097156b
parent462ecf69d368466a20cba60a593bf695b422e9bc (diff)
Fixed argument's argument property ownership
-rw-r--r--src/lib/eldbus/eldbus_model_arguments.c20
-rw-r--r--src/lib/eldbus/eldbus_model_arguments.eo6
-rw-r--r--src/lib/eldbus/eldbus_model_arguments_private.h2
3 files changed, 24 insertions, 4 deletions
diff --git a/src/lib/eldbus/eldbus_model_arguments.c b/src/lib/eldbus/eldbus_model_arguments.c
index cc82a20cb8..28bce61194 100644
--- a/src/lib/eldbus/eldbus_model_arguments.c
+++ b/src/lib/eldbus/eldbus_model_arguments.c
@@ -51,7 +51,19 @@ _eldbus_model_arguments_arguments_set(Eo *obj EINA_UNUSED,
51{ 51{
52 DBG("(%p)", obj); 52 DBG("(%p)", obj);
53 53
54 pd->arguments = arguments; 54 Eldbus_Introspection_Argument* data;
55 EINA_LIST_FREE(pd->arguments, data)
56 {
57 free(data);
58 }
59 pd->arguments = eina_list_clone(arguments);
60 Eina_List* l;
61 EINA_LIST_FOREACH(pd->arguments, l, data)
62 {
63 void* cp = malloc(sizeof(Eldbus_Introspection_Argument));
64 memcpy(cp, data, sizeof(Eldbus_Introspection_Argument));
65 eina_list_data_set(l, cp);
66 }
55} 67}
56 68
57static const Eina_List* 69static const Eina_List*
@@ -115,6 +127,12 @@ _eldbus_model_arguments_eo_base_destructor(Eo *obj, Eldbus_Model_Arguments_Data
115 eina_stringshare_del(pd->name); 127 eina_stringshare_del(pd->name);
116 eldbus_proxy_unref(pd->proxy); 128 eldbus_proxy_unref(pd->proxy);
117 129
130 Eldbus_Introspection_Argument* data;
131 EINA_LIST_FREE(pd->arguments, data)
132 {
133 free(data);
134 }
135
118 eo_do_super(obj, MY_CLASS, eo_destructor()); 136 eo_do_super(obj, MY_CLASS, eo_destructor());
119} 137}
120 138
diff --git a/src/lib/eldbus/eldbus_model_arguments.eo b/src/lib/eldbus/eldbus_model_arguments.eo
index c2c78bf777..1688276393 100644
--- a/src/lib/eldbus/eldbus_model_arguments.eo
+++ b/src/lib/eldbus/eldbus_model_arguments.eo
@@ -15,8 +15,10 @@ class Eldbus.Model_Arguments (Eo.Base, Efl.Model.Base) {
15 [[Custom Eldbus_Model_Arguments constructor. 15 [[Custom Eldbus_Model_Arguments constructor.
16 16
17 @since 1.16]] 17 @since 1.16]]
18 set {} 18 set {
19 get {} 19 }
20 get {
21 }
20 values { 22 values {
21 arguments: const(list<Eldbus_Introspection_Argument*>)* @optional; [[The introspected arguments]] 23 arguments: const(list<Eldbus_Introspection_Argument*>)* @optional; [[The introspected arguments]]
22 } 24 }
diff --git a/src/lib/eldbus/eldbus_model_arguments_private.h b/src/lib/eldbus/eldbus_model_arguments_private.h
index fc93552a81..33a9d7d497 100644
--- a/src/lib/eldbus/eldbus_model_arguments_private.h
+++ b/src/lib/eldbus/eldbus_model_arguments_private.h
@@ -19,7 +19,7 @@ struct _Eldbus_Model_Arguments_Data
19 Eina_Hash *properties_hash; 19 Eina_Hash *properties_hash;
20 Eina_Stringshare *name; 20 Eina_Stringshare *name;
21 Eina_List *pending_list; 21 Eina_List *pending_list;
22 const Eina_List *arguments; 22 Eina_List *arguments;
23 Eina_Value tmp_value; 23 Eina_Value tmp_value;
24}; 24};
25 25