gdesktopappinfo: Unref the GDBus call results

On our GDBus call callback wrapper we were completing the gdbus call but
ignoring the returned value, that was always leaked.

Fix this.

Helps with: https://gitlab.gnome.org/GNOME/glib/-/issues/333
This commit is contained in:
Marco Trevisan (Treviño) 2022-09-02 20:38:46 +02:00
parent 026a69905e
commit 221f22b6e1

View File

@ -3283,15 +3283,19 @@ launch_uris_with_dbus_cb (GObject *object,
{ {
GTask *task = G_TASK (user_data); GTask *task = G_TASK (user_data);
GError *local_error = NULL; GError *local_error = NULL;
GVariant *ret;
g_dbus_connection_call_finish (G_DBUS_CONNECTION (object), result, &local_error); ret = g_dbus_connection_call_finish (G_DBUS_CONNECTION (object), result, &local_error);
if (local_error != NULL) if (local_error != NULL)
{ {
g_dbus_error_strip_remote_error (local_error); g_dbus_error_strip_remote_error (local_error);
g_task_return_error (task, g_steal_pointer (&local_error)); g_task_return_error (task, g_steal_pointer (&local_error));
} }
else else
g_task_return_boolean (task, TRUE); {
g_task_return_boolean (task, TRUE);
g_variant_unref (ret);
}
g_object_unref (task); g_object_unref (task);
} }