Skip to content

Commit

Permalink
pk-client: Fix runtime warning when backend does not support role
Browse files Browse the repository at this point in the history
The daemon returns "op not supported by the backend" as part of the method
call response, but this response can be received after the "Destroy" signal,
which causes infinite wait for the transaction end and runtime warnings
about NULL error being passed to the g_task_return_error() on the client side.

This is a regression from commit PackageKit@44215db
  • Loading branch information
mcrha committed Jul 22, 2024
1 parent 29f59af commit cbb5a6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/packagekit-glib2/pk-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1616,11 +1616,11 @@ pk_client_signal_cb (GDBusProxy *proxy,
if (g_strcmp0 (signal_name, "Destroy") == 0) {
g_autoptr(GError) local_error = NULL;

if (state->waiting_for_finished)
if (state->waiting_for_finished) {
local_error = g_error_new_literal (PK_CLIENT_ERROR, PK_CLIENT_ERROR_FAILED,
"PackageKit transaction disappeared");

pk_client_state_finish (state, g_steal_pointer (&local_error));
pk_client_state_finish (state, g_steal_pointer (&local_error));
}
return;
}
}
Expand Down

0 comments on commit cbb5a6d

Please sign in to comment.