Skip to content

Commit

Permalink
pk-client: Fix pkmon gtask warning caused by PkClient refcount issue
Browse files Browse the repository at this point in the history
Fixes 'GTask finalized without ever returning (using
g_task_return_*())' warning message while running `pkmon` and gives
the proper output.

This was caused because `PkClientState` was finalized incorrectly,
causing the state's gtask object to be finalized causing the warning.

Fixes: PackageKit#709
  • Loading branch information
sidt4 committed May 19, 2024
1 parent 50e3cbf commit 25668a0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/packagekit-glib2/pk-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ pk_client_state_unset_proxy (PkClientState *state)
state);
g_clear_object (&state->proxy);
}

g_object_unref (state);
}

static void
Expand Down Expand Up @@ -1657,6 +1659,8 @@ pk_client_proxy_connect (PkClientState *state)
guint i;
g_auto(GStrv) props = NULL;

g_object_ref (state);

/* coldplug properties */
props = g_dbus_proxy_get_cached_property_names (state->proxy);
for (i = 0; props != NULL && props[i] != NULL; i++) {
Expand Down

0 comments on commit 25668a0

Please sign in to comment.