summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2021-05-13 11:33:48 +0200
committerRichard Hughes <richard@hughsie.com>2021-05-13 12:44:40 +0100
commit4d50be0c67eebad80930982d59088433978c7d36 (patch)
tree7334d43259ccc88d9990018446bfd8242864ee84 /lib
parent9b7e083cf849c4ed4d66fe32250f1615ab577d94 (diff)
pk-client: Correct 'cancellable' use in pk_client_repair_system_async()
Two problems: a) the 'state->cancellable' is not a new cancellable like in every other place; b) the passed-in cancellable is supposed to be set into 'state->cancellable_client', because on that cancellable is the signal disconnected, aka the disconnect won't work for this function. Signed-off-by: Richard Hughes <richard@hughsie.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/packagekit-glib2/pk-client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/packagekit-glib2/pk-client.c b/lib/packagekit-glib2/pk-client.c
index 24ba378df..01976dcec 100644
--- a/lib/packagekit-glib2/pk-client.c
+++ b/lib/packagekit-glib2/pk-client.c
@@ -4404,8 +4404,9 @@ pk_client_repair_system_async (PkClient *client,
state->role = PK_ROLE_ENUM_REPAIR_SYSTEM;
state->res = g_object_ref (res);
state->client = g_object_ref (client);
+ state->cancellable = g_cancellable_new ();
if (cancellable != NULL) {
- state->cancellable = g_object_ref (cancellable);
+ state->cancellable_client = g_object_ref (cancellable);
state->cancellable_id = g_cancellable_connect (cancellable, G_CALLBACK (pk_client_cancellable_cancel_cb), state, NULL);
}
state->transaction_flags = transaction_flags;