discomfitor pushed a commit to annotated tag v0.20.2.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=ea1256c7ff67ba05fd32216c1d6ef7029417cc42

commit ea1256c7ff67ba05fd32216c1d6ef7029417cc42
Author: Marcel Hollerbach <marcel-hollerb...@t-online.de>
Date:   Fri Dec 18 13:15:25 2015 +0100

    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
---
 src/modules/mixer/e_mod_main.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/modules/mixer/e_mod_main.c b/src/modules/mixer/e_mod_main.c
index d907a09..8dcdaf8 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

-- 


Reply via email to