[totem] skipto: Avoid crash when activating the skipto dialogue



commit 23f5c9a3d8eb8a3165626b4db4176941a7708a36
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Aug 25 14:47:20 2015 +0200

    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.

 src/plugins/skipto/totem-skipto.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/skipto/totem-skipto.c b/src/plugins/skipto/totem-skipto.c
index b79ee8b..8314db2 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 *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]