mirror of
https://github.com/encounter/SDL.git
synced 2025-12-16 16:37:09 +00:00
Android: concurrency issues, make sure Activity is in running State when calling
functions like SDL_CreateWindow, SDL_CreateRenderer, Android_GLES_CreateContext Bugs 4694, 4681, 4142
This commit is contained in:
@@ -49,7 +49,15 @@ Android_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
|
||||
SDL_GLContext
|
||||
Android_GLES_CreateContext(_THIS, SDL_Window * window)
|
||||
{
|
||||
return SDL_EGL_CreateContext(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
|
||||
SDL_GLContext ret;
|
||||
|
||||
Android_ActivityMutex_Lock_Running();
|
||||
|
||||
ret = SDL_EGL_CreateContext(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
|
||||
|
||||
SDL_UnlockMutex(Android_ActivityMutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -42,7 +42,7 @@ Android_CreateWindow(_THIS, SDL_Window * window)
|
||||
SDL_WindowData *data;
|
||||
int retval = 0;
|
||||
|
||||
SDL_LockMutex(Android_ActivityMutex);
|
||||
Android_ActivityMutex_Lock_Running();
|
||||
|
||||
if (Android_Window) {
|
||||
retval = SDL_SetError("Android only supports one window");
|
||||
|
||||
Reference in New Issue
Block a user