remove pulse sinks/sources from list before running cbs which access the list

this guarantees a crash any time the default sink gets removed since it will
always re-set the about-to-be-deleted default sink as the default sink

fix T3277 probably
This commit is contained in:
Mike Blumenkrantz 2016-05-17 15:05:18 -04:00
parent cad34648c6
commit a71b5170dc
1 changed files with 3 additions and 3 deletions

View File

@ -257,11 +257,11 @@ _sink_remove_cb(int index, void *data EINA_UNUSED)
{ {
if (sink->idx == index) if (sink->idx == index)
{ {
ctx->sinks = eina_list_remove_list(ctx->sinks, l);
if (ctx->cb) if (ctx->cb)
ctx->cb((void *)ctx->userdata, EMIX_SINK_REMOVED_EVENT, ctx->cb((void *)ctx->userdata, EMIX_SINK_REMOVED_EVENT,
(Emix_Sink *)sink); (Emix_Sink *)sink);
_sink_del(sink); _sink_del(sink);
ctx->sinks = eina_list_remove_list(ctx->sinks, l);
break; break;
} }
} }
@ -405,13 +405,13 @@ _sink_input_remove_cb(int index, void *data EINA_UNUSED)
{ {
if (input->idx == index) if (input->idx == index)
{ {
ctx->inputs = eina_list_remove_list(ctx->inputs, l);
if (ctx->cb) if (ctx->cb)
ctx->cb((void *)ctx->userdata, ctx->cb((void *)ctx->userdata,
EMIX_SINK_INPUT_REMOVED_EVENT, EMIX_SINK_INPUT_REMOVED_EVENT,
(Emix_Sink_Input *)input); (Emix_Sink_Input *)input);
_sink_input_del(input); _sink_input_del(input);
ctx->inputs = eina_list_remove_list(ctx->inputs, l);
break; break;
} }
} }
@ -510,12 +510,12 @@ _source_remove_cb(int index, void *data EINA_UNUSED)
{ {
if (source->idx == index) if (source->idx == index)
{ {
ctx->sources = eina_list_remove_list(ctx->sources, l);
if (ctx->cb) if (ctx->cb)
ctx->cb((void *)ctx->userdata, EMIX_SOURCE_REMOVED_EVENT, ctx->cb((void *)ctx->userdata, EMIX_SOURCE_REMOVED_EVENT,
(Emix_Source *)source); (Emix_Source *)source);
_source_del(source); _source_del(source);
ctx->sources = eina_list_remove_list(ctx->sources, l);
break; break;
} }
} }