From 5b0c44c06c88443f7831e2dccb3078b87425d21c Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 8 Nov 2024 17:17:47 -0300 Subject: [PATCH] calendar-combo-row: Fix a memory leak --- src/gui/gcal-calendar-combo-row.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/gcal-calendar-combo-row.c b/src/gui/gcal-calendar-combo-row.c index 61d65f14..7cdc1c6a 100644 --- a/src/gui/gcal-calendar-combo-row.c +++ b/src/gui/gcal-calendar-combo-row.c @@ -238,8 +238,12 @@ gcal_calendar_combo_row_set_calendar (GcalCalendarComboRow *self, for (guint i = 0; i < g_list_model_get_n_items (model); i++) { - if (g_list_model_get_item (model, i) == calendar) - adw_combo_row_set_selected (ADW_COMBO_ROW (self), i); + g_autoptr (GcalCalendar) aux = g_list_model_get_item (model, i); + if (aux == calendar) + { + adw_combo_row_set_selected (ADW_COMBO_ROW (self), i); + break; + } } g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_CALENDAR]);