core/calendar-monitor: Clear shared rw-lock on finalize

In gcal_calendar_monitor_init(), self->shared.lock is initialized with
g_rw_lock_init(). On Linux/glibc, GRWLock allocates memory for the
underlying pthread_rwlock_t (56 bytes).

Because g_rw_lock_clear() was never called in gcal_calendar_monitor_finalize(),
every finalized GcalCalendarMonitor leaked its lock resources, failing the
LeakSanitizer CI build when test_calendar_monitor_expand_recurrences was added.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/808>
This commit is contained in:
John Cardullo
2026-10-27 11:10:58 -07:00
parent 2aaac879d4
commit c7b1c977f7
+2
View File
@@ -1327,6 +1327,8 @@ gcal_calendar_monitor_finalize (GObject *object)
g_clear_pointer (&self->shared.filter, g_free);
g_clear_pointer (&self->shared.range, gcal_range_unref);
g_rw_lock_clear (&self->shared.lock);
G_OBJECT_CLASS (gcal_calendar_monitor_parent_class)->finalize (object);
}