Skip to content

Loading…

Minor improvement to DNSEvidenceSource #234

Merged
merged 1 commit into from

2 participants

@VladimirTechMan
Collaborator

The changes ensure that we always interact with an existing instance of DNSEvidenceSource inside the queued blocks. Though it would be hard to get the related problem in practice, let's ensure there is no "worst case" here anyway.

@dustinrue dustinrue merged commit 3a4b7d8 into dustinrue:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 7, 2013
  1. Minor improvement to DNSEvidenceSource

    VladimirTechMan committed
Showing with 7 additions and 7 deletions.
  1. +7 −7 Source/DNSEvidenceSource.m
View
14 Source/DNSEvidenceSource.m
@@ -175,10 +175,10 @@ - (void)start {
return;
}
- CFRetain(store);
+ [self retain];
dispatch_async(queue, ^{
[self doFullUpdateFromStore:store];
- CFRelease(store);
+ [self release];
});
running = YES;
@@ -198,12 +198,12 @@ - (void)doStop {
}
if (queue) {
+ [self retain];
dispatch_async(queue, ^{
- @autoreleasepool {
- self.searchDomains = [NSSet set];
- self.dnsServers = [NSSet set];
- [self setDataCollected:NO];
- }
+ self.searchDomains = [NSSet set];
+ self.dnsServers = [NSSet set];
+ [self setDataCollected:NO];
+ [self release];
});
dispatch_release(queue);
queue = NULL;
Something went wrong with that request. Please try again.