Skip to content

Commit

Permalink
pk-client: Fix GTask warning caused by PkClientState refcount issue
Browse files Browse the repository at this point in the history
Fixes the following warning message while running 'pkmon' and gives
the proper output.

"GTask finalized without ever returning (using g_task_return_*())"

This was caused because 'PkClientState' was finalized incorrectly,
causing the state's 'GTask' object to be finalized before expected,
causing the warning.

Fixes: PackageKit#709
  • Loading branch information
sidt4 committed May 19, 2024
1 parent 50e3cbf commit b9609ee
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 b9609ee

Please sign in to comment.