diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index cc096924f7..c0c73bcf6c 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -1226,7 +1226,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceChanged)(JNIEnv *env, j SDL_LockMutex(Android_ActivityMutex); #ifdef SDL_VIDEO_OPENGL_EGL - if (Android_Window) { + if (Android_Window && (Android_Window->flags & SDL_WINDOW_OPENGL)) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); SDL_WindowData *data = Android_Window->internal; @@ -1256,7 +1256,7 @@ retry: SDL_WindowData *data = Android_Window->internal; /* Wait for Main thread being paused and context un-activated to release 'egl_surface' */ - if (!data->backup_done) { + if ((Android_Window->flags & SDL_WINDOW_OPENGL) && !data->backup_done) { nb_attempt -= 1; if (nb_attempt == 0) { SDL_SetError("Try to release egl_surface with context probably still active");