From 4d5911644a88bce297f723aebb51c3e63ebf4d3b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 14 Sep 2012 10:00:13 +0000 Subject: [PATCH] unset mixer gadget configs when the backend changes, also don't delete the gadget instances; this should fix the last of the mixer crashing issues SVN revision: 76653 --- src/modules/mixer/e_mod_main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/mixer/e_mod_main.c b/src/modules/mixer/e_mod_main.c index fc282c5be..c475039dc 100644 --- a/src/modules/mixer/e_mod_main.c +++ b/src/modules/mixer/e_mod_main.c @@ -117,7 +117,9 @@ _mixer_gadget_configuration_defaults(E_Mixer_Gadget_Config *conf) return 0; } + eina_stringshare_del(conf->card); conf->card = card; + eina_stringshare_del(conf->channel_name); conf->channel_name = channel; conf->lock_sliders = 1; conf->show_locked = 0; @@ -952,6 +954,7 @@ e_mod_mixer_pulse_ready(Eina_Bool ready) E_Mixer_Instance *inst; E_Mixer_Module_Context *ctxt; Eina_List *l; + Eina_Bool pulse = _mixer_using_default; if (!mixer_mod) return; @@ -961,14 +964,16 @@ e_mod_mixer_pulse_ready(Eina_Bool ready) ctxt = mixer_mod->data; EINA_LIST_FOREACH(ctxt->instances, l, inst) { + if (pulse != _mixer_using_default) + _mixer_gadget_configuration_defaults(inst->conf); if ((!_mixer_sys_setup(inst)) && (!_mixer_sys_setup_defaults(inst))) { if (inst->sys) e_mod_mixer_del(inst->sys); - _mixer_gadget_configuration_free(ctxt->conf, inst->conf); - E_FREE(inst); + inst->sys = NULL; return; } + if (_mixer_using_default) e_mixer_system_callback_set(inst->sys, _mixer_system_cb_update, inst); e_mod_mixer_state_get(inst->sys, inst->channel, &inst->mixer_state); _mixer_gadget_update(inst); }