summaryrefslogtreecommitdiff
path: root/res/ari
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-03-29 13:47:08 -0500
committerRichard Mudgett <rmudgett@digium.com>2016-03-30 16:36:20 -0500
commit0ea742d33a89c8d1d3b92eceb833cbe79faab954 (patch)
tree9b1f0acf578ac015ce8adc1e4e72163a96958511 /res/ari
parent53f63ad7704b1b1f2b1465a23f89900266fc8115 (diff)
res_stasis: Add control ref to playback and recording structs.
The stasis_app_playback and stasis_app_recording structs need to have a struct stasis_app_control ref. Other threads can get a reference to the playback and recording structs from their respective global container. These other threads can then use the control pointer they contain after the control struct has gone. * Add control ref to stasis_app_playback and stasis_app_recording structs. With the refs added, the control command queue can now have a circular control reference which will cause the control struct to never get released if the control's command queue is not flushed when the channel leaves the Stasis application. Also the command queue needs better protection from adding commands if the control->is_done flag is set. * Flush the control command queue on exit. ASTERISK-25882 #close Change-Id: I3cf1fb59cbe6f50f20d9e35a2c07ac07d7f4320d
Diffstat (limited to 'res/ari')
-rw-r--r--res/ari/resource_bridges.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/res/ari/resource_bridges.c b/res/ari/resource_bridges.c
index 7b9b94665..93bdc6217 100644
--- a/res/ari/resource_bridges.c
+++ b/res/ari/resource_bridges.c
@@ -296,10 +296,11 @@ static void *bridge_channel_control_thread(void *data)
thread_data = NULL;
stasis_app_control_execute_until_exhausted(bridge_channel, control);
+ stasis_app_control_flush_queue(control);
- ast_hangup(bridge_channel);
- ao2_cleanup(control);
stasis_forward_cancel(forward);
+ ao2_cleanup(control);
+ ast_hangup(bridge_channel);
return NULL;
}