summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-09-14 08:17:11 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-09-14 08:17:11 +0000
commit1a7737d5a111eef806a2fcc7782eb9c6bfc29ded (patch)
tree982f295497967e6d8f2537a5bacc1d59da4f2684
parent6a53321e5cff89c991ba9ffc01dd6171a49746ae (diff)
downloadenlightenment-1a7737d5a111eef806a2fcc7782eb9c6bfc29ded.tar.gz
fix mixer stringshare usage (fixes looooooooots of crashes), also shutdown pulse integration when unloading the module
SVN revision: 76649
-rw-r--r--src/modules/mixer/e_mod_main.c1
-rw-r--r--src/modules/mixer/sys_pulse.c17
2 files changed, 12 insertions, 6 deletions
diff --git a/src/modules/mixer/e_mod_main.c b/src/modules/mixer/e_mod_main.c
index 32cb5ce6a3..fc282c5bed 100644
--- a/src/modules/mixer/e_mod_main.c
+++ b/src/modules/mixer/e_mod_main.c
@@ -1545,6 +1545,7 @@ e_modapi_shutdown(E_Module *m)
#ifdef HAVE_ENOTIFY
e_notification_shutdown();
#endif
+ e_mixer_pulse_shutdown();
E_FREE(ctxt);
mixer_mod = NULL;
diff --git a/src/modules/mixer/sys_pulse.c b/src/modules/mixer/sys_pulse.c
index 2bb210c16e..88da73996f 100644
--- a/src/modules/mixer/sys_pulse.c
+++ b/src/modules/mixer/sys_pulse.c
@@ -127,6 +127,8 @@ _pulse_sinks_get(Pulse *p __UNUSED__, Pulse_Tag_Id id __UNUSED__, Eina_List *ev)
Eina_List *l;
Pulse_Sink *sink;
+ E_FREE_LIST(sinks, pulse_sink_free);
+
EINA_LIST_FOREACH(ev, l, sink)
{
/*
@@ -370,16 +372,16 @@ e_mixer_pulse_get_cards(void)
Pulse_Sink *sink;
EINA_LIST_FOREACH(sinks, l, sink)
- ret = eina_list_append(ret, pulse_sink_name_get(sink));
+ ret = eina_list_append(ret, eina_stringshare_ref(pulse_sink_name_get(sink)));
EINA_LIST_FOREACH(sources, l, sink)
- ret = eina_list_append(ret, pulse_sink_name_get(sink));
+ ret = eina_list_append(ret, eina_stringshare_ref(pulse_sink_name_get(sink)));
return ret;
}
void
e_mixer_pulse_free_cards(Eina_List *cards)
{
- eina_list_free(cards);
+ E_FREE_LIST(cards, eina_stringshare_del);
}
const char *
@@ -393,10 +395,13 @@ e_mixer_pulse_get_default_card(void)
const char *
e_mixer_pulse_get_card_name(const char *card)
{
- Pulse_Sink *sink = _pulse_sink_find(card);
- const char *s = pulse_sink_desc_get(sink);
+ Pulse_Sink *sink;
+ const char *s;
+
+ sink = _pulse_sink_find(card);
+ s = pulse_sink_desc_get(sink);
if ((!s) || (!s[0])) s = pulse_sink_name_get(sink);
- return eina_stringshare_add(s);
+ return eina_stringshare_ref(s);
}
Eina_List *