diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c index 515b2b98..8b660026 100644 --- a/src/gcal-month-view.c +++ b/src/gcal-month-view.c @@ -1638,8 +1638,11 @@ gcal_month_view_add (GtkContainer *container, l = g_hash_table_lookup (priv->single_day_children, GINT_TO_POINTER (date->day)); l = g_list_insert_sorted (l, widget, (GCompareFunc) gcal_event_widget_compare_by_start_date); - if (g_list_length (l) == 1) - g_hash_table_insert (priv->single_day_children, GINT_TO_POINTER (date->day), l); + if (g_list_length (l) != 1) + { + g_hash_table_steal (priv->single_day_children, GINT_TO_POINTER (date->day)); + } + g_hash_table_insert (priv->single_day_children, GINT_TO_POINTER (date->day), l); g_free (date); }