Skip to content

Commit

Permalink
Merge pull request #52 from brianvanderwal/master
Browse files Browse the repository at this point in the history
Fix memory leak by invalidating the NSURLSession when finished
  • Loading branch information
SoneeJohn authored Dec 18, 2017
2 parents d99f287 + 2297808 commit 57bf479
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions YTVimeoExtractor/YTVimeoExtractorOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,18 @@ + (BOOL) automaticallyNotifiesObserversForKey:(NSString *)key
}

-(void)finishOperationWithError:(NSError *)error{

_error = error;
[self finish];

[self.networkSession invalidateAndCancel];
}

-(void)finishOperationWithVideo:(YTVimeoVideo *)video{

_operationVideo = video;
_error = nil;
[self finish];
[self.networkSession finishTasksAndInvalidate];
}

- (void)finish
{
self.isExecuting = NO;
Expand Down

0 comments on commit 57bf479

Please sign in to comment.