aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-09-08 18:06:26 +0100
committerConor Curran <conor.curran@canonical.com>2010-09-08 18:06:26 +0100
commit8034c9103ba03b8fa782ca3bccbb293282ff5a4c (patch)
treed01d2c807c8179d69723ff05613fe9f4cca93128 /src
parentc5d9ac1900b094287dd18a347dd62a04e153bbdb (diff)
downloadayatana-indicator-sound-8034c9103ba03b8fa782ca3bccbb293282ff5a4c.tar.gz
ayatana-indicator-sound-8034c9103ba03b8fa782ca3bccbb293282ff5a4c.tar.bz2
ayatana-indicator-sound-8034c9103ba03b8fa782ca3bccbb293282ff5a4c.zip
some defensive code in place to protect against rare seg-fault on the volume slider
Diffstat (limited to 'src')
-rw-r--r--src/indicator-sound.c3
-rw-r--r--src/sound-service.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 0e631fa..4cab754 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -661,6 +661,7 @@ key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer data)
GtkWidget* slider_widget = volume_widget_get_ido_slider(VOLUME_WIDGET(priv->volume_widget));
GtkWidget* slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)slider_widget);
GtkRange* range = (GtkRange*)slider;
+ g_return_val_if_fail(GTK_IS_RANGE(range), FALSE);
gdouble current_value = gtk_range_get_value(range);
gdouble new_value = current_value;
const gdouble five_percent = 5;
@@ -729,6 +730,8 @@ indicator_sound_scroll (IndicatorObject *io, gint delta, IndicatorScrollDirectio
GtkWidget* slider_widget = volume_widget_get_ido_slider(VOLUME_WIDGET(priv->volume_widget));
GtkWidget* slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)slider_widget);
GtkRange* range = (GtkRange*)slider;
+ g_return_if_fail(GTK_IS_RANGE(range));
+
gdouble value = gtk_range_get_value(range);
GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE (slider));
g_debug("indicator-sound-scroll - current slider value %f", value);
diff --git a/src/sound-service.c b/src/sound-service.c
index f19379d..51f5f37 100644
--- a/src/sound-service.c
+++ b/src/sound-service.c
@@ -41,8 +41,8 @@ service_shutdown (IndicatorService *service, gpointer user_data)
if (mainloop != NULL) {
g_debug("Service shutdown !");
//TODO: uncomment for release !!
- close_pulse_activites();
- g_main_loop_quit(mainloop);
+ //close_pulse_activites();
+ //g_main_loop_quit(mainloop);
}
return;
}