summaryrefslogtreecommitdiff
path: root/apps/app_confbridge.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_confbridge.c')
-rw-r--r--apps/app_confbridge.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c
index 76a269bb1..edae7b154 100644
--- a/apps/app_confbridge.c
+++ b/apps/app_confbridge.c
@@ -775,8 +775,6 @@ static int conf_start_record(struct conference_bridge *conference_bridge)
*/
static int start_conf_record_thread(struct conference_bridge *conference_bridge)
{
- ao2_ref(conference_bridge, +1); /* give the record thread a ref */
-
conf_start_record(conference_bridge);
/*
@@ -786,6 +784,8 @@ static int start_conf_record_thread(struct conference_bridge *conference_bridge)
return 0;
}
+ ao2_ref(conference_bridge, +1); /* give the record thread a ref */
+
if (ast_pthread_create_background(&conference_bridge->record_thread, NULL, record_thread, conference_bridge)) {
ast_log(LOG_WARNING, "Failed to create recording channel for conference %s\n", conference_bridge->name);
ao2_ref(conference_bridge, -1); /* error so remove ref */