Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 6 app crashes in EAGLContext when displaying maps

We have an app that uses OpenGL and MKMapView. When we switched to iOS 6 it started crashing at [EAGLContext setCurrentContext:] with EXC_BAD_ACCESS whenever we tried to display a map after setting our own EAGLContext.

like image 520
Darren Avatar asked Oct 01 '12 09:10

Darren


1 Answers

iOS 6 maps are OpenGL based. Your app will crash if you don't call

[EAGLContext setCurrentContext:nil]

after you have set your own EAGLContext. We fixed our bug by putting the above call into the dealloc method of our class that was interacting with EAGLContext.

like image 66
Darren Avatar answered Oct 19 '22 09:10

Darren