diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2013-11-10 11:04:18 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2013-11-10 11:04:18 +0900 |
commit | 35228f32f189f90975729ca2dd0f3755f0e3db03 (patch) | |
tree | dee047bdd336976f7a9193a1285831dacc74768c /src/lib/ecore_audio | |
parent | 3b531d01bd7be7f0bbffab935dd88794933e0f6d (diff) |
ecore-audio - handle deletion of objects from outputs list in ctx fail cb
Diffstat (limited to 'src/lib/ecore_audio')
-rw-r--r-- | src/lib/ecore_audio/ecore_audio_obj_out_pulse.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c index 2c3f2ffdbc..11fc20f537 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c +++ b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c | |||
@@ -243,12 +243,21 @@ static void _state_job(void *data EINA_UNUSED) | |||
243 | (class_vars.state == PA_CONTEXT_TERMINATED)) | 243 | (class_vars.state == PA_CONTEXT_TERMINATED)) |
244 | { | 244 | { |
245 | Eo *eo_obj; | 245 | Eo *eo_obj; |
246 | Eina_List *out; | 246 | Eina_List *out, *tmp; |
247 | 247 | ||
248 | DBG("PA context fail."); | 248 | DBG("PA context fail."); |
249 | //ref everything in the list to be sure... | ||
250 | EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { | ||
251 | eo_ref(eo_obj); | ||
252 | } | ||
253 | // the callback here can delete things in the list.. | ||
249 | EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { | 254 | EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { |
250 | eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_OUT_PULSE_CONTEXT_FAIL, NULL, NULL)); | 255 | eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_OUT_PULSE_CONTEXT_FAIL, NULL, NULL)); |
251 | } | 256 | } |
257 | // now unref everything safely | ||
258 | EINA_LIST_FOREACH_SAFE(class_vars.outputs, out, tmp, eo_obj) { | ||
259 | eo_unref(eo_obj); | ||
260 | } | ||
252 | } | 261 | } |
253 | class_vars.state_job = NULL; | 262 | class_vars.state_job = NULL; |
254 | } | 263 | } |