From dd183d039f3ee053b1d3f77b97d7802439a2678c Mon Sep 17 00:00:00 2001 From: RaphWeyman Date: Sat, 12 Mar 2016 12:51:17 +0000 Subject: [PATCH] Update SOGoActiveSyncDispatcher.m Add local memory pool so as to restrict memory consumption while waiting in the ping cycle. Consumption can otherwise grow quite large while if the SOGoMaximumPingInterval and SOGoMaximumSyncInterval have been increased to allow for push ActiveSync. --- ActiveSync/SOGoActiveSyncDispatcher.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m index 154984ddd..5705254e5 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.m +++ b/ActiveSync/SOGoActiveSyncDispatcher.m @@ -2017,7 +2017,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. NSMutableString *s; id collection; NSData *d; - + NSAutoreleasePool *pool; int i, j, heartbeatInterval, defaultInterval, internalInterval, status; @@ -2076,6 +2076,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // We enter our loop detection change for (i = 0; i < (heartbeatInterval/internalInterval); i++) { + pool = [[NSAutoreleasePool alloc] init]; for (j = 0; j < [allFoldersID count]; j++) { collectionId = [allFoldersID objectAtIndex: j]; @@ -2100,7 +2101,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [foldersWithChanges addObject: collectionId]; } } - + DESTROY(pool); + if ([foldersWithChanges count]) { [self logWithFormat: @"Change detected using Ping, we let the EAS client know to send a Sync."];