mirror of
https://github.com/flatpak/flatpak.git
synced 2026-03-14 13:15:35 -04:00
document portal: cope with multiple events that would cause failure
If the name is lost *and* the session bus is closed, we would crash with an assertion failure when the GError is overwritten. Signed-off-by: Simon McVittie <smcv@debian.org>
This commit is contained in:
@@ -972,8 +972,13 @@ on_name_lost (GDBusConnection *connection,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_debug ("%s lost", name);
|
||||
final_exit_status = 20;
|
||||
g_set_error (&exit_error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "D-Bus name \"%s\" lost", name);
|
||||
|
||||
if (final_exit_status == 0)
|
||||
final_exit_status = 20;
|
||||
|
||||
if (exit_error == NULL)
|
||||
g_set_error (&exit_error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "D-Bus name \"%s\" lost", name);
|
||||
|
||||
g_main_loop_quit (loop);
|
||||
}
|
||||
|
||||
@@ -991,7 +996,9 @@ session_bus_closed (GDBusConnection *connection,
|
||||
gboolean remote_peer_vanished,
|
||||
GError *bus_error)
|
||||
{
|
||||
g_set_error (&exit_error, G_IO_ERROR, G_IO_ERROR_BROKEN_PIPE, "Disconnected from session bus");
|
||||
if (exit_error == NULL)
|
||||
g_set_error (&exit_error, G_IO_ERROR, G_IO_ERROR_BROKEN_PIPE, "Disconnected from session bus");
|
||||
|
||||
g_main_loop_quit (loop);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user