priv = MODEST_UI_DIMMING_MANAGER_GET_PRIVATE(obj);
- if (priv->delayed_calls != NULL) {
+ if (priv->delayed_calls != NULL && (g_hash_table_size (priv->delayed_calls) > 0)) {
/* Remove all pending calls */
g_hash_table_foreach (priv->delayed_calls,
remove_all_timeouts,
modest_ui_dimming_manager_new()
{
ModestUIDimmingManager *obj;
-
+
obj = MODEST_UI_DIMMING_MANAGER(g_object_new(MODEST_TYPE_UI_DIMMING_MANAGER, NULL));
priv = MODEST_UI_DIMMING_MANAGER_GET_PRIVATE(helper->manager);
g_hash_table_remove (priv->delayed_calls, helper->name);
- priv->delayed_calls = NULL;
g_free (helper->name);
g_object_unref (helper->manager);
g_slice_free (DelayedDimmingRules, helper);