Skip to content

Commit

Permalink
Merge pull request #10748 from tellowkrinkle/SDL22Fun
Browse files Browse the repository at this point in the history
InputCommon: SDL 2.0.22 init crash workaround
  • Loading branch information
JosJuice authored Jun 15, 2022
2 parents f73b14b + 994210e commit 107a928
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ void Init()
ERROR_LOG_FMT(CONTROLLERINTERFACE, "SDL failed to initialize");
return;
#else
#if defined(__APPLE__) && !SDL_VERSION_ATLEAST(2, 0, 24)
// Bug in SDL 2.0.22 requires the first init to be done on the main thread to avoid crashing
SDL_InitSubSystem(SDL_INIT_JOYSTICK);
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
#endif
s_hotplug_thread = std::thread([] {
Common::ScopeGuard quit_guard([] {
// TODO: there seems to be some sort of memory leak with SDL, quit isn't freeing everything up
Expand Down

0 comments on commit 107a928

Please sign in to comment.