fix(addressbook): close DB connection after DAV query

This commit is contained in:
Francis Lachapelle committed 2022-02-01 10:14:37 -05:00
1 parent 7c81e3acec
commit 348a79c795
4 files changed
+24 -7

No files matched your search

+13 -4
View File
@@ -440,6 +440,17 @@
return channel;
}
- (void) releaseConnection: (id) connection
{
GCSChannelManager *cm;
if (connection)
{
cm = [GCSChannelManager defaultChannelManager];
[cm releaseChannel: connection];
}
}
- (NSDictionary *) _lookupContactEntry: (NSString *) theID
considerEmail: (BOOL) b
inDomain: (NSString *) domain
@@ -678,18 +689,16 @@
inDomain: (NSString *) domain
{
EOAdaptorChannel *channel;
GCSChannelManager *cm;
NSDictionary *response;
cm = [GCSChannelManager defaultChannelManager];
channel = (EOAdaptorChannel *)[self connection];
response = [self _lookupContactEntry: theID
considerEmail: b
inDomain: domain
usingConnection: channel];
if (channel)
[cm releaseChannel: channel];
[self releaseConnection: channel];
return response;
}