Commit 2c1efded authored by Jehan's avatar Jehan

app: do not free non-allocated DBus manager.

While this issue was unseen so far on common desktop machines, the CI
build encountered it, hence failing 6 of the unit tests.
A connection to the bus could not be established hence the dbus_manager
was never allocated, and finally it would crash at exit if we tried to
unref it unconditionnally. Use g_clear_object() instead.

Also add some stderr output for easier debugging, for when one of the 2
possible error cases might happen (as documented by g_bus_own_name()).
parent 450ebd5e
......@@ -409,6 +409,12 @@ gui_dbus_name_lost (GDBusConnection *connection,
const gchar *name,
Gimp *gimp)
if (connection == NULL)
g_printerr ("%s: connection to the bus cannot be established.\n",
g_printerr ("%s: the name \"%s\" could not be acquired on the bus.\n",
G_STRFUNC, name);
static void
......@@ -430,7 +436,7 @@ static void
gui_dbus_service_exit (void)
g_bus_unown_name (dbus_name_id);
g_object_unref (dbus_manager);
g_clear_object (&dbus_manager);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment