mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-04 00:19:20 +00:00
fix(addressbook): use pool to lower memory usage
This commit is contained in:
1 parent
4e6a7f5705
commit
a073241e0f
3 files changed
+23
-3
No files matched your search
@@ -1288,11 +1288,13 @@ groupObjectClasses: (NSArray *) newGroupObjectClasses
|
||||
withCriteria: (NSArray *) criteria
|
||||
inDomain: (NSString *) theDomain
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
NGLdapConnection *ldapConnection;
|
||||
NGLdapEntry *currentEntry;
|
||||
NSEnumerator *entries;
|
||||
NSMutableArray *contacts;
|
||||
EOQualifier *qualifier;
|
||||
unsigned int i;
|
||||
|
||||
contacts = [NSMutableArray array];
|
||||
|
||||
@@ -1313,9 +1315,21 @@ groupObjectClasses: (NSArray *) newGroupObjectClasses
|
||||
entries = [ldapConnection deepSearchAtBaseDN: _baseDN
|
||||
qualifier: qualifier
|
||||
attributes: _lookupFields];
|
||||
|
||||
i = 0;
|
||||
pool = [NSAutoreleasePool new];
|
||||
while ((currentEntry = [entries nextObject]))
|
||||
[contacts addObject:
|
||||
[self _convertLDAPEntryToContact: currentEntry]];
|
||||
{
|
||||
[contacts addObject:
|
||||
[self _convertLDAPEntryToContact: currentEntry]];
|
||||
i++;
|
||||
if (i % 10 == 0)
|
||||
{
|
||||
[pool release];
|
||||
pool = [NSAutoreleasePool new];
|
||||
}
|
||||
}
|
||||
[pool release];
|
||||
}
|
||||
|
||||
return contacts;
|
||||
|
||||
Reference in new issue
Block a user