summaryrefslogtreecommitdiff
path: root/src/lib/eldbus
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-10-07 10:04:18 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-10-07 10:04:18 -0400
commit5cc9ea90c4a0381990e9fd961a99b74d0ce4fade (patch)
tree107c9b30c8cbf3b71c1488e0cd207d72de612d3a /src/lib/eldbus
parentd28870daa7506bb73af4e92ee8b48c952f3d6aa6 (diff)
eldbus: properly cleanup local variable during destruction.
Summary: Depends on D10288 Reviewers: zmike, bu5hm4n, segfaultxavi, stefan_schmidt, jsuya Reviewed By: zmike Subscribers: ProhtMeyhet, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10289
Diffstat (limited to 'src/lib/eldbus')
-rw-r--r--src/lib/eldbus/eldbus_model.c9
-rw-r--r--src/lib/eldbus/eldbus_signal_handler.c10
2 files changed, 12 insertions, 7 deletions
diff --git a/src/lib/eldbus/eldbus_model.c b/src/lib/eldbus/eldbus_model.c
index 3fc4e66..ee86ff5 100644
--- a/src/lib/eldbus/eldbus_model.c
+++ b/src/lib/eldbus/eldbus_model.c
@@ -54,8 +54,11 @@ _eldbus_model_connection_set(Eo *obj EINA_UNUSED,
54 Eldbus_Model_Data *pd, 54 Eldbus_Model_Data *pd,
55 Eldbus_Connection *dbus) 55 Eldbus_Connection *dbus)
56{ 56{
57 Eldbus_Connection *tounref = pd->connection;
58
57 eldbus_connection_ref(dbus); 59 eldbus_connection_ref(dbus);
58 if (pd->connection) eldbus_connection_unref(pd->connection); 60 pd->connection = NULL;
61 if (tounref) eldbus_connection_unref(tounref);
59 pd->connection = dbus; 62 pd->connection = dbus;
60} 63}
61 64
@@ -77,8 +80,10 @@ _eldbus_model_efl_object_finalize(Eo *obj, Eldbus_Model_Data *pd)
77static void 80static void
78_eldbus_model_efl_object_invalidate(Eo *obj, Eldbus_Model_Data *pd) 81_eldbus_model_efl_object_invalidate(Eo *obj, Eldbus_Model_Data *pd)
79{ 82{
80 if (pd->connection) eldbus_connection_unref(pd->connection); 83 Eldbus_Connection *connection = pd->connection;
84
81 pd->connection = NULL; 85 pd->connection = NULL;
86 if (connection) eldbus_connection_unref(connection);
82 87
83 efl_invalidate(efl_super(obj, MY_CLASS)); 88 efl_invalidate(efl_super(obj, MY_CLASS));
84} 89}
diff --git a/src/lib/eldbus/eldbus_signal_handler.c b/src/lib/eldbus/eldbus_signal_handler.c
index dba557b..3ed7cb3 100644
--- a/src/lib/eldbus/eldbus_signal_handler.c
+++ b/src/lib/eldbus/eldbus_signal_handler.c
@@ -241,14 +241,14 @@ _eldbus_signal_handler_del(Eldbus_Signal_Handler *handler)
241 241
242 /* after cbs_free dispatch these shouldn't exit, error if they do */ 242 /* after cbs_free dispatch these shouldn't exit, error if they do */
243 243
244 eina_stringshare_del(handler->sender); 244 eina_stringshare_replace(&handler->sender, NULL);
245 eina_stringshare_del(handler->path); 245 eina_stringshare_replace(&handler->path, NULL);
246 eina_stringshare_del(handler->interface); 246 eina_stringshare_replace(&handler->interface, NULL);
247 eina_stringshare_del(handler->member); 247 eina_stringshare_replace(&handler->member, NULL);
248 eina_strbuf_free(handler->match); 248 eina_strbuf_free(handler->match);
249 EINA_INLIST_FOREACH_SAFE(handler->args, list, arg) 249 EINA_INLIST_FOREACH_SAFE(handler->args, list, arg)
250 { 250 {
251 eina_stringshare_del(arg->value); 251 eina_stringshare_replace(&arg->value, NULL);
252 free(arg); 252 free(arg);
253 } 253 }
254 eina_inlist_sorted_state_free(handler->state_args); 254 eina_inlist_sorted_state_free(handler->state_args);