summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-11-15 09:39:38 -0800
committerStefan Schmidt <s.schmidt@samsung.com>2019-11-18 11:46:11 +0100
commit3f3b7259453a4519e40e90b15962331158928ac4 (patch)
treed57e350f801719154136b0c73062ddaa17faf93b
parent54217cda84b4019dfe8fd3428c7258f3ac58ae8c (diff)
eldbus: only free the data when the future is resolved or rejected.
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Differential Revision: https://phab.enlightenment.org/D10684
-rw-r--r--src/lib/eldbus/eldbus_model_proxy.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/lib/eldbus/eldbus_model_proxy.c b/src/lib/eldbus/eldbus_model_proxy.c
index bf1f8fb..d0cbcb5 100644
--- a/src/lib/eldbus/eldbus_model_proxy.c
+++ b/src/lib/eldbus/eldbus_model_proxy.c
@@ -39,8 +39,6 @@ struct _Eldbus_Property_Promise
39 Eina_Stringshare *property; 39 Eina_Stringshare *property;
40}; 40};
41 41
42static void _eldbus_model_proxy_property_set_data_free(Eldbus_Model_Proxy_Property_Set_Data *);
43
44static Eina_Bool 42static Eina_Bool
45_eldbus_model_proxy_load(Eldbus_Model_Proxy_Data *pd) 43_eldbus_model_proxy_load(Eldbus_Model_Proxy_Data *pd)
46{ 44{
@@ -236,6 +234,9 @@ _eldbus_model_proxy_cancel_cb(Efl_Loop_Consumer *consumer EINA_UNUSED,
236 Eldbus_Model_Proxy_Property_Set_Data *sd = data; 234 Eldbus_Model_Proxy_Property_Set_Data *sd = data;
237 235
238 sd->promise = NULL; 236 sd->promise = NULL;
237 eina_stringshare_del(sd->property);
238 eina_value_free(sd->value);
239 free(sd);
239} 240}
240 241
241static Eldbus_Pending * 242static Eldbus_Pending *
@@ -655,7 +656,6 @@ _eldbus_model_proxy_property_set_load_cb(void *data,
655 if (!signature || !properties) 656 if (!signature || !properties)
656 { 657 {
657 eina_promise_reject(set_data->promise, EFL_MODEL_ERROR_UNKNOWN); 658 eina_promise_reject(set_data->promise, EFL_MODEL_ERROR_UNKNOWN);
658 _eldbus_model_proxy_property_set_data_free(set_data);
659 goto end; 659 goto end;
660 } 660 }
661 661
@@ -688,7 +688,7 @@ _eldbus_model_proxy_property_set_cb(void *data,
688 { 688 {
689 ERR("%s: %s", error_name, error_text); 689 ERR("%s: %s", error_name, error_text);
690 eina_promise_reject(sd->promise, EFL_MODEL_ERROR_UNKNOWN); 690 eina_promise_reject(sd->promise, EFL_MODEL_ERROR_UNKNOWN);
691 goto end; 691 return;
692 } 692 }
693 693
694 value = eina_hash_find(pd->properties, sd->property); 694 value = eina_hash_find(pd->properties, sd->property);
@@ -705,9 +705,6 @@ _eldbus_model_proxy_property_set_cb(void *data,
705 eina_promise_reject(sd->promise, 705 eina_promise_reject(sd->promise,
706 EFL_MODEL_ERROR_NOT_FOUND); 706 EFL_MODEL_ERROR_NOT_FOUND);
707 } 707 }
708
709 end:
710 _eldbus_model_proxy_property_set_data_free(sd);
711} 708}
712 709
713static const char * 710static const char *
@@ -726,13 +723,4 @@ _eldbus_model_proxy_property_type_get(Eldbus_Model_Proxy_Data *pd,
726 return property_introspection->type; 723 return property_introspection->type;
727} 724}
728 725
729static void
730_eldbus_model_proxy_property_set_data_free(Eldbus_Model_Proxy_Property_Set_Data *data)
731{
732 EINA_SAFETY_ON_NULL_RETURN(data);
733 eina_stringshare_del(data->property);
734 eina_value_free(data->value);
735 free(data);
736}
737
738#include "eldbus_model_proxy.eo.c" 726#include "eldbus_model_proxy.eo.c"