以下代码块运行良好,并从另一个视图向自身添加模糊视图。
但是,在设备轮换后,任何对"更新"的调用都会触发Assertion Failure: GPUImageFramebuffer.m:269
"Tried to overrelease a framebuffer, did you forget to call -useNextFrameForImageCapture before using -imageFromCurrentFramebuffer?"
我无法找到原因。删除和撤消GPUImageView没有帮助。我做错了什么?
GPUImageiOSBlurFilter *blurFilter=[[GPUImageiOSBlurFilter alloc]init];
blurFilter.blurRadiusInPixels = 3.0f;
self.gImageView=[[GPUImageView alloc]init];
AppDelegate *appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
self.gpuImageUIElement =[[GPUImageUIElement alloc]initWithView:(appDelegate.mainViewController).baseholder.view];
[_gpuImageUIElement addTarget:blurFilter];
[blurFilter addTarget:_gImageView];
_gImageView.frame=self.view.frame;
_gImageView.alpha=0.01;
[self.view insertSubview:_gImageView atIndex:0];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
[_gpuImageUIElement update];
dispatch_async(dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.4 delay:0 options:0 animations:^{
_gImageView.alpha=1;
} completion:^(BOOL finished) {
}];
});
});