iOS crash in SDL_ukitopenglview->swapBuffers -EXC_BAD_ACCESS

Sometimes method SDL_ukitopenglview.swapBuffers was crashing on me, and I didn’t knew when.
Now I can reproduce the problem, it seems like a bug, not sure.

I’m opening the itunes app store from my game, and everytime I do this, swapBuffers crashes with EXC_BAD_ACCESS.

This is how I’m opening the store:

[[UIApplication sharedApplication] openURL:nsURL];

Where nsURL is “itms-apps://itunes.apple.com/app/XXXX”

This isn?t really a bug, you just need to handle app events properly (i.e. call glFinish inside an event watch callback when SDL_APP_DIDENTERBACKGROUND is triggered, and make sure to not call any GL functions or SwapWindow after that.)

Read more here: https://developer.apple.com/library/ios/documentation/3ddrawing/conceptual/opengles_programmingguide/ImplementingaMultitasking-awareOpenGLESApplication/ImplementingaMultitasking-awareOpenGLESApplication.html

SDL?s readme-iOS file shows how to use the app events with an event watch callback, as well.On Aug 30, 2014, at 5:48 PM, Limanima <jorge.raposo.lima at gmail.com> wrote:

Sometimes method SDL_ukitopenglview.swapBuffers was crashing on me, and I didn’t knew when.
Now I can reproduce the problem, it seems like a bug, not sure.

I’m opening the itunes app store from my game, and everytime I do this, swapBuffers crashes with EXC_BAD_ACCESS.

This is how I’m opening the store:

[[UIApplication sharedApplication] openURL:nsURL];

Where nsURL is “itms-apps://itunes.apple.com/app/XXXX”


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

To clarify, the OS is killing your app, it?s not necessarily crashing.On Aug 30, 2014, at 5:53 PM, Alex Szpakowski <@Alex_Szpakowski> wrote:

This isn?t really a bug

On Aug 30, 2014, at 5:48 PM, Limanima <jorge.raposo.lima at gmail.com> wrote:

Sometimes method SDL_ukitopenglview.swapBuffers was crashing on me, and I didn’t knew when.
Now I can reproduce the problem, it seems like a bug, not sure.

I’m opening the itunes app store from my game, and everytime I do this, swapBuffers crashes with EXC_BAD_ACCESS.

This is how I’m opening the store:

[[UIApplication sharedApplication] openURL:nsURL];

Where nsURL is “itms-apps://itunes.apple.com/app/XXXX”


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Alex Szpakowski wrote:

This isn?t really a bug, you just need to handle app events properly (i.e. call glFinish inside an event watch callback when SDL_APP_DIDENTERBACKGROUND is triggered, and make sure to not call any GL functions or SwapWindow after that.)

Read more here: https://developer.apple.com/library/ios/documentation/3ddrawing/conceptual/opengles_programmingguide/ImplementingaMultitasking-awareOpenGLESApplication/ImplementingaMultitasking-awareOpenGLESApplication.html (https://developer.apple.com/library/ios/documentation/3ddrawing/conceptual/opengles_programmingguide/ImplementingaMultitasking-awareOpenGLESApplication/ImplementingaMultitasking-awareOpenGLESApplication.html)

SDL?s readme-iOS file shows how to use the app events with an event watch callback, as well.

I’m actually pausing/resuming my draw/update loop when the application enters background/foreground, but I wasn’t calling glFinish. I added glFinish and it seems to be fine now!
This gFinish detail is not in the readme, and my opengl knowledge is unfortunately weak.

Thanks for the quick reply.