diff options
author | Marcel Hollerbach <marcel-hollerbach@t-online.de> | 2015-12-18 13:15:25 +0100 |
---|---|---|
committer | Marcel Hollerbach <marcel-hollerbach@t-online.de> | 2015-12-18 13:21:08 +0100 |
commit | f174008a8374daab0fc4355f804e0b342280aeb4 (patch) | |
tree | ced171b81e3652200b2f3a11f3dd569def84a088 | |
parent | d9e01e851f0066301f1a8b27769a53fbb6c5c3d6 (diff) | |
download | enlightenment-f174008a8374daab0fc4355f804e0b342280aeb4.tar.gz |
mixer: only save state if not in init
If we are calling emix_config_save_state_get while in init, we are
freeing the list emix_config_save_state_restore is iterating over.
This leads to crashes.
@fix T2942
@fix T2906
-rw-r--r-- | src/modules/mixer/e_mod_main.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/modules/mixer/e_mod_main.c b/src/modules/mixer/e_mod_main.c index d907a0940d..8dcdaf8f13 100644 --- a/src/modules/mixer/e_mod_main.c +++ b/src/modules/mixer/e_mod_main.c @@ -7,6 +7,7 @@ #define VOLUME_STEP 5 int _e_emix_log_domain; +static Eina_Bool init; /* module requirements */ E_API E_Module_Api e_modapi = @@ -650,7 +651,6 @@ _sink_event(int type, void *info) mixer_context->sink_default = l->data; else mixer_context->sink_default = NULL; - emix_config_save_state_get(); if (emix_config_save_get()) e_config_save_queue(); _mixer_gadget_update(); } @@ -667,8 +667,17 @@ _sink_event(int type, void *info) { DBG("Sink added"); } - emix_config_save_state_get(); - if (emix_config_save_get()) e_config_save_queue(); + /* + Only safe the state if we are not in init mode, + If we are in init mode, this is a result of the restore call. + Restore iterates over a list of sinks which would get deleted in the + save_state_get call. + */ + if (!init) + { + emix_config_save_state_get(); + if (emix_config_save_get()) e_config_save_queue(); + } } static void @@ -678,9 +687,11 @@ _disconnected(void) _mixer_gadget_update(); } + static void _ready(void) { + init = EINA_TRUE; if (emix_sink_default_support()) mixer_context->sink_default = emix_sink_default_get(); else @@ -713,6 +724,7 @@ _ready(void) } _mixer_gadget_update(); + init = EINA_FALSE; } static void |