lib/repo-pull: Factor out free function for FetchDeltaSuperData
This introduces no functional changes, but does make the code a little cleaner. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1599 Approved by: jlebon
This commit is contained in:
parent
66777b1b75
commit
fc10354404
|
|
@ -2461,6 +2461,16 @@ typedef struct {
|
||||||
OstreeCollectionRef *requested_ref; /* (nullable) */
|
OstreeCollectionRef *requested_ref; /* (nullable) */
|
||||||
} FetchDeltaSuperData;
|
} FetchDeltaSuperData;
|
||||||
|
|
||||||
|
static void
|
||||||
|
fetch_delta_super_data_free (FetchDeltaSuperData *fetch_data)
|
||||||
|
{
|
||||||
|
g_free (fetch_data->from_revision);
|
||||||
|
g_free (fetch_data->to_revision);
|
||||||
|
if (fetch_data->requested_ref)
|
||||||
|
ostree_collection_ref_free (fetch_data->requested_ref);
|
||||||
|
g_free (fetch_data);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_required_deltas_error (GError **error,
|
set_required_deltas_error (GError **error,
|
||||||
const char *from_revision,
|
const char *from_revision,
|
||||||
|
|
@ -2541,15 +2551,12 @@ on_superblock_fetched (GObject *src,
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
g_free (fdata->from_revision);
|
|
||||||
g_free (fdata->to_revision);
|
|
||||||
if (fdata->requested_ref)
|
|
||||||
ostree_collection_ref_free (fdata->requested_ref);
|
|
||||||
g_free (fdata);
|
|
||||||
g_assert (pull_data->n_outstanding_metadata_fetches > 0);
|
g_assert (pull_data->n_outstanding_metadata_fetches > 0);
|
||||||
pull_data->n_outstanding_metadata_fetches--;
|
pull_data->n_outstanding_metadata_fetches--;
|
||||||
pull_data->n_fetched_metadata++;
|
pull_data->n_fetched_metadata++;
|
||||||
check_outstanding_requests_handle_error (pull_data, &local_error);
|
check_outstanding_requests_handle_error (pull_data, &local_error);
|
||||||
|
|
||||||
|
g_clear_pointer (&fetch_data, fetch_delta_super_data_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue