summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2015-08-25 14:47:20 +0200
committerBastien Nocera <hadess@hadess.net>2015-08-25 14:51:28 +0200
commit23f5c9a3d8eb8a3165626b4db4176941a7708a36 (patch)
tree450cb8896603186ccde59fee5136e5827f52bbe2
parent917ff3e5340fe6687624adf59c92d34117513b45 (diff)
downloadtotem-23f5c9a3d8eb8a3165626b4db4176941a7708a36.tar.gz
skipto: Avoid crash when activating the skipto dialogue
The dialogue will have been destroyed by the time the spinbutton's adjustment will emit a signal, make sure we don't try to access it during dispose.
-rw-r--r--src/plugins/skipto/totem-skipto.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/skipto/totem-skipto.c b/src/plugins/skipto/totem-skipto.c
index b79ee8b60..8314db28a 100644
--- a/src/plugins/skipto/totem-skipto.c
+++ b/src/plugins/skipto/totem-skipto.c
@@ -162,9 +162,18 @@ time_entry_activate_cb (GtkEntry *entry, TotemSkipto *skipto)
static void
tstw_adjustment_value_changed_cb (GtkAdjustment *adjustment, TotemSkipto *skipto)
{
+ int value;
+
+ g_return_if_fail (TOTEM_IS_SKIPTO (skipto));
+
+ if (skipto->priv->seconds_label == NULL)
+ return;
+
+ value = (int) gtk_adjustment_get_value (adjustment);
+
/* Update the "seconds" label so that it always has the correct singular/plural form */
/* Translators: label for the seconds selector in the "Skip to" dialogue */
- gtk_label_set_label (skipto->priv->seconds_label, ngettext ("second", "seconds", (int) gtk_adjustment_get_value (adjustment)));
+ gtk_label_set_label (skipto->priv->seconds_label, ngettext ("second", "seconds", value));
}
GtkWidget *