Skip to content

Commit

Permalink
fix(calendar): Memory optimization on _appendCycleException
Browse files Browse the repository at this point in the history
  • Loading branch information
WoodySlum committed May 28, 2024
1 parent 31c0473 commit 45fd999
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SoObjects/Appointments/SOGoAppointmentFolder.m
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,9 @@ - (void) _appendCycleException: (iCalRepeatableEntityObject *) component
withTimeZone: (NSTimeZone *) tz
toArray: (NSMutableArray *) ma
{
NSAutoreleasePool *pool;

pool = [[NSAutoreleasePool alloc] init];
NGCalendarDateRange *recurrenceIdRange;
NSCalendarDate *recurrenceId, *masterEndDate, *endDate;
NSMutableDictionary *newRecord;
Expand Down Expand Up @@ -1162,6 +1165,7 @@ - (void) _appendCycleException: (iCalRepeatableEntityObject *) component
endDate: [newRecord objectForKey: @"endDate"]];
if ([dateRange doesIntersectWithDateRange: newRecordRange])
[ma addObject: newRecord];

else
newRecord = nil;
} else {
Expand All @@ -1184,6 +1188,8 @@ - (void) _appendCycleException: (iCalRepeatableEntityObject *) component
[self _fixExceptionRecord: newRecord fromRow: row];
}

DESTROY(pool);

// We finally adjust the c_nextalarm
[self _computeAlarmForRow: (id)row
master: component];
Expand Down

0 comments on commit 45fd999

Please sign in to comment.