aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-sound.c
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/indicator-sound.c
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/indicator-sound.c')
-rw-r--r--src/indicator-sound.c3
1 files changed, 3 insertions, 0 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);