Android crash on device orientation change

I have OpenGL support running on Android, w/ JUCE 4 (I cannot upgrade to 5).

Everything is fine, with the exception of crashing on device orientation change, after a few rotations (usually between 3 and 6). Note: if I use the SW renderer instead, I don’t see the crash.

I believe this has been fixed in JUCE 5, but it’s untenable for me to upgrade. Has anyone solved this on JUCE 4? Specifically, the crash backtrace is:

  • android/Surface/hook_perform/ANativeWindow
  • eglCreateWindowSurface
  • OpenGLContext::CachedImage.runJob

Above that it’s calling a pure virtual function and then crashing.


@fabian – any input?

It’s hard to narrow it down as there were a lot of changes in the Android code between JUCE 4 and 5. If you know roughly where it was fixed then you can run git bisect to track down the specific commit which fixed it.

I’m not even sure that 5 did fix the issue, though it sounds like it has since people have stopped complaining about GL crashes. I was hoping that someone who had worked on this would be able to give a more direct answer.