mirror of
https://github.com/libsdl-org/SDL.git
synced 2024-11-23 02:43:30 +08:00
cocoa: Refuse to SDL_Init(SDL_INIT_VIDEO) from background thread.
Fixes #11437. Reference PR #11502.
This commit is contained in:
parent
932bb968d7
commit
2b744c7df3
@ -63,6 +63,10 @@ static SDL_VideoDevice *Cocoa_CreateDevice(void)
|
||||
SDL_VideoDevice *device;
|
||||
SDL_CocoaVideoData *data;
|
||||
|
||||
if (![NSThread isMainThread]) {
|
||||
return NULL; // this doesn't SDL_SetError() because SDL_VideoInit is just going to overwrite it.
|
||||
}
|
||||
|
||||
Cocoa_RegisterApp();
|
||||
|
||||
// Initialize all variables that we clean on shutdown
|
||||
|
Loading…
Reference in New Issue
Block a user