* Fixes NB#86725, fixes NB#86266, show the error banner whenever folder creation...
[modest] / src / modest-ui-dimming-manager.c
index 3f33a2c..36b90df 100644 (file)
@@ -105,6 +105,15 @@ modest_ui_dimming_manager_init (ModestUIDimmingManager *obj)
 }
 
 static void
+remove_all_timeouts (gpointer key, 
+                    gpointer value, 
+                    gpointer user_data)
+{
+       if (GPOINTER_TO_INT (value) > 0)
+               g_source_remove (GPOINTER_TO_INT (value));
+}
+
+static void
 modest_ui_dimming_manager_finalize (GObject *obj)
 {
        ModestUIDimmingManagerPrivate *priv;
@@ -114,8 +123,14 @@ modest_ui_dimming_manager_finalize (GObject *obj)
        if (priv->groups_map != NULL)
                g_hash_table_unref (priv->groups_map);
 
-       if (priv->delayed_calls != NULL)
+       if (priv->delayed_calls != NULL) {
+               /* Remove all pending calls */
+               g_hash_table_foreach (priv->delayed_calls,
+                                     remove_all_timeouts,
+                                     NULL);
+
                g_hash_table_unref (priv->delayed_calls);
+       }
 
        G_OBJECT_CLASS(parent_class)->finalize (obj);
 }