forked from enlightenment/efl
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
This commit is contained in:
parent
d28870daa7
commit
5cc9ea90c4
|
@ -54,8 +54,11 @@ _eldbus_model_connection_set(Eo *obj EINA_UNUSED,
|
|||
Eldbus_Model_Data *pd,
|
||||
Eldbus_Connection *dbus)
|
||||
{
|
||||
Eldbus_Connection *tounref = pd->connection;
|
||||
|
||||
eldbus_connection_ref(dbus);
|
||||
if (pd->connection) eldbus_connection_unref(pd->connection);
|
||||
pd->connection = NULL;
|
||||
if (tounref) eldbus_connection_unref(tounref);
|
||||
pd->connection = dbus;
|
||||
}
|
||||
|
||||
|
@ -77,8 +80,10 @@ _eldbus_model_efl_object_finalize(Eo *obj, Eldbus_Model_Data *pd)
|
|||
static void
|
||||
_eldbus_model_efl_object_invalidate(Eo *obj, Eldbus_Model_Data *pd)
|
||||
{
|
||||
if (pd->connection) eldbus_connection_unref(pd->connection);
|
||||
Eldbus_Connection *connection = pd->connection;
|
||||
|
||||
pd->connection = NULL;
|
||||
if (connection) eldbus_connection_unref(connection);
|
||||
|
||||
efl_invalidate(efl_super(obj, MY_CLASS));
|
||||
}
|
||||
|
|
|
@ -241,14 +241,14 @@ _eldbus_signal_handler_del(Eldbus_Signal_Handler *handler)
|
|||
|
||||
/* after cbs_free dispatch these shouldn't exit, error if they do */
|
||||
|
||||
eina_stringshare_del(handler->sender);
|
||||
eina_stringshare_del(handler->path);
|
||||
eina_stringshare_del(handler->interface);
|
||||
eina_stringshare_del(handler->member);
|
||||
eina_stringshare_replace(&handler->sender, NULL);
|
||||
eina_stringshare_replace(&handler->path, NULL);
|
||||
eina_stringshare_replace(&handler->interface, NULL);
|
||||
eina_stringshare_replace(&handler->member, NULL);
|
||||
eina_strbuf_free(handler->match);
|
||||
EINA_INLIST_FOREACH_SAFE(handler->args, list, arg)
|
||||
{
|
||||
eina_stringshare_del(arg->value);
|
||||
eina_stringshare_replace(&arg->value, NULL);
|
||||
free(arg);
|
||||
}
|
||||
eina_inlist_sorted_state_free(handler->state_args);
|
||||
|
|
Loading…
Reference in New Issue