[evolution/gnome-3-18] [EActivityBar] Do not remove timeout GSource twice in dispose



commit bef0eea739d35d9a56441ebc2dc6c9a8fcae13b6
Author: Milan Crha <mcrha redhat com>
Date:   Tue Nov 10 18:40:59 2015 +0100

    [EActivityBar] Do not remove timeout GSource twice in dispose
    
    When the window holding the activity bar is closed, the widget itself
    has run dispose. it's possible that the timeout source holds the last
    reference to the widget, thus when the GSource is removed, it also
    unreferences the widget, which calls the dispose again and it is
    tried again to remove the same GSource. using a temporary variable
    and setting the private variable to zero before the removal fixes
    the critical warning which this double-remove causes.

 e-util/e-activity-bar.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/e-util/e-activity-bar.c b/e-util/e-activity-bar.c
index d601e76..62f205f 100644
--- a/e-util/e-activity-bar.c
+++ b/e-util/e-activity-bar.c
@@ -254,8 +254,10 @@ activity_bar_dispose (GObject *object)
        priv = E_ACTIVITY_BAR_GET_PRIVATE (object);
 
        if (priv->timeout_id > 0) {
-               g_source_remove (priv->timeout_id);
+               guint timeout_id = priv->timeout_id;
+
                priv->timeout_id = 0;
+               g_source_remove (timeout_id);
        }
 
        if (priv->activity != NULL) {


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