aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-03-14 15:04:10 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-03-14 15:04:10 -0500
commit6d53111b169442dc56f1fdeddea809326b8f2740 (patch)
treefc3b443349a6a1bbd06d18dcdd947bbe2993213a
parent29e476ae9f9711fdd67197eb997923651fea563c (diff)
parentf61ca4cc7e620fe55b4d91f6a798abb3063fdcf2 (diff)
downloadayatana-indicator-sound-6d53111b169442dc56f1fdeddea809326b8f2740.tar.gz
ayatana-indicator-sound-6d53111b169442dc56f1fdeddea809326b8f2740.tar.bz2
ayatana-indicator-sound-6d53111b169442dc56f1fdeddea809326b8f2740.zip
fix pa_operation_unref(NULL) crash by merging ~cjcurran/indicator-sound/global-mute-defensive
-rw-r--r--src/pulseaudio-mgr.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/pulseaudio-mgr.c b/src/pulseaudio-mgr.c
index b8d754f..f205723 100644
--- a/src/pulseaudio-mgr.c
+++ b/src/pulseaudio-mgr.c
@@ -218,7 +218,7 @@ pm_update_mute (gboolean update)
if (!operation){
g_warning ("pm_update_mute operation failed for some reason");
return;
- }
+ }
pa_operation_unref (operation);
}
@@ -633,17 +633,23 @@ pm_toggle_mute_for_every_sink_callback (pa_context *c,
if (eol > 0) {
return;
}
- else {
- if (sink == NULL) {
- g_warning ("toggle_mute cb - sink parameter is null - why ?");
- return;
- }
- pa_operation_unref (pa_context_set_sink_mute_by_index (c,
- sink->index,
- GPOINTER_TO_INT(userdata),
- NULL,
- NULL));
+
+ if (sink == NULL) {
+ g_warning ("toggle_mute cb - sink parameter is null - why ?");
+ return;
}
+
+ pa_operation *operation = NULL;
+ operation = pa_context_set_sink_mute_by_index (c,
+ sink->index,
+ GPOINTER_TO_INT(userdata),
+ NULL,
+ NULL);
+ if (!operation){
+ g_warning ("pm_update_mic_mute operation failed for some reason");
+ return;
+ }
+ pa_operation_unref (operation);
}
// Source info related callbacks