From 01dce3414295ed4e2df5e61e4796878bc8347658 Mon Sep 17 00:00:00 2001 From: smizrahi Date: Wed, 15 May 2024 15:41:49 +0200 Subject: [PATCH] fix(calendar): Memory optimization on _appendCycleException --- SoObjects/Appointments/SOGoAppointmentFolder.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 6d99aaf5d..13baf5080 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -1075,6 +1075,9 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir withTimeZone: (NSTimeZone *) tz toArray: (NSMutableArray *) ma { + NSAutoreleasePool *pool; + + pool = [[NSAutoreleasePool alloc] init]; NGCalendarDateRange *recurrenceIdRange; NSCalendarDate *recurrenceId, *masterEndDate, *endDate; NSMutableDictionary *newRecord; @@ -1162,6 +1165,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir endDate: [newRecord objectForKey: @"endDate"]]; if ([dateRange doesIntersectWithDateRange: newRecordRange]) [ma addObject: newRecord]; + else newRecord = nil; } else { @@ -1184,6 +1188,8 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir [self _fixExceptionRecord: newRecord fromRow: row]; } + DESTROY(pool); + // We finally adjust the c_nextalarm [self _computeAlarmForRow: (id)row master: component];