linux: (de)initialize d-bus at init and quit.
Previously we had different subsystems quitting it, in conflict, and risked multiple threads racing to init it at the same time. Fixes #3643.
This commit is contained in:
parent
57c2a4566f
commit
dbdbae44c5
3 changed files with 11 additions and 12 deletions
11
src/SDL.c
11
src/SDL.c
|
@ -34,6 +34,9 @@
|
|||
#include "thread/os2/SDL_systls_c.h"
|
||||
#endif
|
||||
|
||||
/* this checks for HAVE_DBUS_DBUS_H internally. */
|
||||
#include "core/linux/SDL_dbus.h"
|
||||
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
|
@ -155,6 +158,10 @@ SDL_InitSubSystem(Uint32 flags)
|
|||
/* Clear the error message */
|
||||
SDL_ClearError();
|
||||
|
||||
#if SDL_USE_LIBDBUS
|
||||
SDL_DBus_Init();
|
||||
#endif
|
||||
|
||||
if ((flags & SDL_INIT_GAMECONTROLLER)) {
|
||||
/* game controller implies joystick */
|
||||
flags |= SDL_INIT_JOYSTICK;
|
||||
|
@ -442,6 +449,10 @@ SDL_Quit(void)
|
|||
SDL_AssertionsQuit();
|
||||
SDL_LogResetPriorities();
|
||||
|
||||
#if SDL_USE_LIBDBUS
|
||||
SDL_DBus_Quit();
|
||||
#endif
|
||||
|
||||
/* Now that every subsystem has been quit, we reset the subsystem refcount
|
||||
* and the list of initialized subsystems.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue