config: only shutdown libhal if the connection is valid.
Thanks to libdbus' extensive use of assert we won't just get an error, it'll bring the whole server down for us.
This commit is contained in:
parent
7732898aaa
commit
fb07fab2c0
|
@ -283,13 +283,15 @@ disconnect_hook(void *data)
|
|||
struct config_hal_info *info = data;
|
||||
|
||||
if (info->hal_ctx) {
|
||||
if (dbus_connection_get_is_connected(info->system_bus)) {
|
||||
dbus_error_init(&error);
|
||||
if (!libhal_ctx_shutdown(info->hal_ctx, &error))
|
||||
DebugF("[config/hal] couldn't shut down context: %s (%s)\n",
|
||||
error.name, error.message);
|
||||
libhal_ctx_free(info->hal_ctx);
|
||||
dbus_error_free(&error);
|
||||
}
|
||||
libhal_ctx_free(info->hal_ctx);
|
||||
}
|
||||
|
||||
info->hal_ctx = NULL;
|
||||
info->system_bus = NULL;
|
||||
|
|
Loading…
Reference in New Issue
Block a user