[easytag] Fix status bar crash on shutdown



commit f7354423c7a2d668465b9a5451ff3c5d5e0d83a6
Author: David King <amigadave amigadave com>
Date:   Wed Jan 4 18:01:35 2017 +0000

    Fix status bar crash on shutdown
    
    Remove the status bar timer source during finalize, to avoid triggering
    it after the widget is destroyed.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1409783

 src/status_bar.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/status_bar.c b/src/status_bar.c
index ffde1e2..b9188eb 100644
--- a/src/status_bar.c
+++ b/src/status_bar.c
@@ -144,6 +144,20 @@ create_status_bar (EtStatusBar *self)
 }
 
 static void
+et_status_bar_finalize (GObject *object)
+{
+    EtStatusBarPrivate *priv;
+
+    priv = et_status_bar_get_instance_private (ET_STATUS_BAR (object));
+
+    if (priv->timer_id)
+    {
+        g_source_remove (priv->timer_id);
+        priv->timer_id = 0;
+    }
+}
+
+static void
 et_status_bar_init (EtStatusBar *self)
 {
     create_status_bar (self);
@@ -152,6 +166,7 @@ et_status_bar_init (EtStatusBar *self)
 static void
 et_status_bar_class_init (EtStatusBarClass *klass)
 {
+    G_OBJECT_CLASS (klass)->finalize = et_status_bar_finalize;
 }
 
 /*


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