Skip to content

Commit

Permalink
Call dbus_shutdown to make valgrind happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
baines committed Jul 6, 2014
1 parent 1ee96bb commit 1c6cd67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/core/linux/SDL_dbus.c
Expand Up @@ -67,6 +67,7 @@ load_dbus_syms(void)
SDL_DBUS_SYM(error_free);
SDL_DBUS_SYM(get_local_machine_id);
SDL_DBUS_SYM(free);
SDL_DBUS_SYM(shutdown);

#undef SDL_DBUS_SYM
#undef SDL_DBUS_SYM2
Expand Down Expand Up @@ -106,7 +107,7 @@ LoadDBUSLibrary(void)
void
SDL_DBus_Init(void)
{
if (LoadDBUSLibrary() != -1) {
if (!dbus.session_conn && LoadDBUSLibrary() != -1) {
DBusError err;
dbus.error_init(&err);
dbus.session_conn = dbus.bus_get_private(DBUS_BUS_SESSION, &err);
Expand All @@ -128,6 +129,7 @@ SDL_DBus_Quit(void)
if (dbus.session_conn) {
dbus.connection_close(dbus.session_conn);
dbus.connection_unref(dbus.session_conn);
dbus.shutdown();
SDL_memset(&dbus, 0, sizeof(dbus));
}
UnloadDBUSLibrary();
Expand Down
3 changes: 2 additions & 1 deletion src/core/linux/SDL_dbus.h
Expand Up @@ -62,7 +62,8 @@ typedef struct SDL_DBusContext {
dbus_bool_t (*error_is_set)(const DBusError *);
void (*error_free)(DBusError *);
char *(*get_local_machine_id)(void);
void (*free)(void *);
void (*free)(void *);
void (*shutdown)(void);

} SDL_DBusContext;

Expand Down

0 comments on commit 1c6cd67

Please sign in to comment.