Skip to content

Commit 1224dd0

Browse files
committed
Don't retain the delegate for the entirety of graphCommits: since we only need it at the end of the method
1 parent 383515a commit 1224dd0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Classes/git/PBGitHistoryGrapher.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ - (void)graphCommits:(NSArray *)revList
4141
if (!revList || [revList count] == 0)
4242
return;
4343

44-
id strongDelegate = delegate;
4544
//NSDate *start = [NSDate date];
4645
NSThread *currentThread = [NSThread currentThread];
4746
NSDate *lastUpdate = [NSDate date];
@@ -72,7 +71,10 @@ - (void)graphCommits:(NSArray *)revList
7271
//NSLog(@"Graphed %i commits in %f seconds (%f/sec)", counter, duration, counter/duration);
7372

7473
[self sendCommits:commits];
75-
[strongDelegate performSelectorOnMainThread:@selector(finishedGraphing) withObject:nil waitUntilDone:NO];
74+
75+
dispatch_async(dispatch_get_main_queue(), ^{
76+
[self->delegate finishedGraphing];
77+
});
7678
}
7779

7880

0 commit comments

Comments
 (0)