Updated documentation for SDL_HINT_SHUTDOWN_DBUS_ON_QUIT
parent
2348e8b6a2
commit
3deefa6b43
|
@ -2721,18 +2721,18 @@ extern "C" {
|
||||||
#define SDL_HINT_MAIN_CALLBACK_RATE "SDL_MAIN_CALLBACK_RATE"
|
#define SDL_HINT_MAIN_CALLBACK_RATE "SDL_MAIN_CALLBACK_RATE"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Let SDL handle dbus_shutdown().
|
* Cause SDL to call dbus_shutdown() on quit.
|
||||||
*
|
*
|
||||||
* Only enable this option if no other dependency uses D-Bus.
|
* This is useful as a debug tool to validate memory leaks, but shouldn't ever
|
||||||
|
* be set in production applications, as other libraries used by the application
|
||||||
|
* might use dbus under the hood and this cause cause crashes if they continue
|
||||||
|
* after SDL_Quit().
|
||||||
*
|
*
|
||||||
* This option tells SDL that it can safely call dbus_shutdown() when
|
* This variable can be set to the following values:
|
||||||
* SDL_Quit() is called. You must ensure that no other library still uses
|
* "0" - SDL will not call dbus_shutdown() on quit (default)
|
||||||
* D-Bus when SDL_Quit() is called, otherwise resources will be freed while
|
* "1" - SDL will call dbus_shutdown() on quit
|
||||||
* they are still in use, which results in undefined behavior and likely a
|
|
||||||
* crash.
|
|
||||||
*
|
*
|
||||||
* Use this option to prevent memory leaks if your application doesn't use
|
* This hint is available since SDL 3.0.0.
|
||||||
* D-Bus other than through SDL.
|
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_SHUTDOWN_DBUS_ON_QUIT "SDL_SHUTDOWN_DBUS_ON_QUIT"
|
#define SDL_HINT_SHUTDOWN_DBUS_ON_QUIT "SDL_SHUTDOWN_DBUS_ON_QUIT"
|
||||||
|
|
||||||
|
|
|
@ -184,10 +184,11 @@ void SDL_DBus_Quit(void)
|
||||||
dbus.connection_unref(dbus.session_conn);
|
dbus.connection_unref(dbus.session_conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_bool q = SDL_GetHintBoolean(SDL_HINT_SHUTDOWN_DBUS_ON_QUIT, SDL_FALSE);
|
if (SDL_GetHintBoolean(SDL_HINT_SHUTDOWN_DBUS_ON_QUIT, SDL_FALSE)) {
|
||||||
if (q == SDL_TRUE && dbus.shutdown) {
|
if (dbus.shutdown) {
|
||||||
dbus.shutdown();
|
dbus.shutdown();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SDL_zero(dbus);
|
SDL_zero(dbus);
|
||||||
UnloadDBUSLibrary();
|
UnloadDBUSLibrary();
|
||||||
|
|
Loading…
Reference in New Issue