ast_debug(3, "Adding endpoint compositor '%s' to AOR '%s'\n",
task_data->endpoint_state_compositor->name, task_data->aor_options->name);
+ ao2_ref(task_data->endpoint_state_compositor, +1);
if (AST_VECTOR_APPEND(&task_data->aor_options->compositors,
- ao2_bump(task_data->endpoint_state_compositor))) {
+ task_data->endpoint_state_compositor)) {
/* Failed to add so no need to update the endpoint status. Nothing changed. */
- ao2_cleanup(task_data->endpoint_state_compositor);
+ ao2_ref(task_data->endpoint_state_compositor, -1);
return 0;
}
ao2_link(endpoint_subscriptions, sub);
} else {
ast_rwlock_wrlock(&tech_subscriptions_lock);
- if (AST_VECTOR_APPEND(&tech_subscriptions, ao2_bump(sub))) {
- /* Release the ao2_bump that was for the vector and allocation references. */
+ ao2_ref(sub, +1);
+ if (AST_VECTOR_APPEND(&tech_subscriptions, sub)) {
+ /* Release the refs that were for the vector and the allocation. */
ao2_ref(sub, -2);
sub = NULL;
}