BradLarson / GPUImage

An open source iOS framework for GPU-based image and video processing
http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
BSD 3-Clause "New" or "Revised" License
20.25k stars 4.61k forks source link

Dismiss View Controller with GPUImageView #748

Open ProCynic opened 11 years ago

ProCynic commented 11 years ago

Any time I try to dismiss a modal view controller which contains a GPUImageView I get an EXC_BAD_ACCESS error and the app crashes.

The setup is very simple. I setup in storybuilder one view controller which contains a button that preforms a modal segue to a second view controller. The second view controller is an instance of TestViewController, which only has:

- (IBAction)cancel:(id)sender {
  [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
}

The second view controller has a back button wired up to this cancel selector. So far everything works and I can go back and forth between the two view controllers just fine.

However, if I go into storyboard and change the class of the view in the second view controller to GPUImageView I get problems. I can segue into the second view controller just fine, and everything works when I'm there, but when I hit the back button to dismiss the second view controller I get an EXC_BAD_ACCESS error.

BradLarson commented 11 years ago

Is the GPUImageView connected to anything? Does it have a filter chain feeding into it? Is there a live camera feed involved?

In the debugger, can you identify at what line this is crashing?

ProCynic commented 11 years ago

The crash occurs whether or not there is a camera feeding it. I started with a GPUImageStillCamera feeding a GPUImageFilter feeding the GPUImageView, like the example in the docs, but I pared it down to just the presence of the GPUImageView trying to find exactly what was causing the crash. When I have the camera hooked up it works fine until I try to dismiss the view controller.

The crash occurs after the cancel method returns. If the dismiss is animated the animation will be preformed before the crash.