Skip to content

Commit

Permalink
Fix a issue that GPUImageMovie instance is retained by block object b…
Browse files Browse the repository at this point in the history
…ut not released.
  • Loading branch information
haileigu authored and Halley Gu committed Mar 13, 2013
1 parent 3a6e5d4 commit 7d93911
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions framework/Source/GPUImageMovie.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,20 @@ - (void)startProcessing
previousActualFrameTime = CFAbsoluteTimeGetCurrent();

NSDictionary *inputOptions = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:AVURLAssetPreferPreciseDurationAndTimingKey];
AVURLAsset *inputAsset = [[AVURLAsset alloc] initWithURL:self.url options:inputOptions];
AVURLAsset *inputAsset = [[AVURLAsset alloc] initWithURL:self.url options:inputOptions];

GPUImageMovie __block *blockSelf = self;

[inputAsset loadValuesAsynchronouslyForKeys:[NSArray arrayWithObject:@"tracks"] completionHandler: ^{
NSError *error = nil;
AVKeyValueStatus tracksStatus = [inputAsset statusOfValueForKey:@"tracks" error:&error];
if (!tracksStatus == AVKeyValueStatusLoaded)
{
return;
}
self.asset = inputAsset;
[self processAsset];
blockSelf.asset = inputAsset;
[blockSelf processAsset];
blockSelf = nil;
}];
}

Expand Down

0 comments on commit 7d93911

Please sign in to comment.