The epc_object has built-in reference counting. The _destroy function
only erases internal data of the object and seems to be intended in
cases where an object is statically allocated, ignoring the reference
counter. However, this does not seem to be actually used anywhere, and
instead all _destroy instances we found were memory leaks, so we use
_unref there.
At the same time, we don't want to remove _destroy (or corresponding
_init) completely, as it seems to be a part of the public activationd
interface, and removing it could turn out to be a breaking change.
Change-Id: I230d8a48223999eda778e5d301de013cca92c012
ret = epc_event_create(ACTION_EXECUTED_EVENT_ID, &ae_data, &ev);
if (ret < 0) {
log_error("Unable to create action executed event");
- epc_object_destroy(ae_data.action_log);
+ epc_object_unref(ae_data.action_log);
goto out;
}
free(ds_ev->path_namespace);
free(ds_ev->destination);
if (ds_ev->match_params)
- epc_object_destroy(ds_ev->match_params);
+ epc_object_unref(ds_ev->match_params);
if (ds_ev->signal_params)
g_variant_unref(ds_ev->signal_params);
free(ds_ev_data.path_namespace);
free(ds_ev_data.destination);
if (ds_ev_data.match_params)
- epc_object_destroy(ds_ev_data.match_params);
+ epc_object_unref(ds_ev_data.match_params);
}
static void signal_cleanup(struct dbus_signal *s)