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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user