pull: Destroy queue watching GSource
When being more of a library, we can't leave garbage attached to the default main context.
This commit is contained in:
1 parent
b18e21be1d
commit
4c2a8bc210
1 file changed
+7
-4
@@ -1202,6 +1202,7 @@ ostree_pull (OstreeRepo *repo,
|
|||||||
gs_unref_hashtable GHashTable *commits_to_fetch = NULL;
|
gs_unref_hashtable GHashTable *commits_to_fetch = NULL;
|
||||||
gs_free char *branch_rev = NULL;
|
gs_free char *branch_rev = NULL;
|
||||||
gs_free char *remote_mode_str = NULL;
|
gs_free char *remote_mode_str = NULL;
|
||||||
|
GSource *queue_src = NULL;
|
||||||
OtPullData pull_data_real;
|
OtPullData pull_data_real;
|
||||||
OtPullData *pull_data = &pull_data_real;
|
OtPullData *pull_data = &pull_data_real;
|
||||||
SoupURI *summary_uri = NULL;
|
SoupURI *summary_uri = NULL;
|
||||||
@@ -1399,10 +1400,10 @@ ostree_pull (OstreeRepo *repo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
GSource *src = ot_waitable_queue_create_source (pull_data->metadata_objects_to_fetch);
|
queue_src = ot_waitable_queue_create_source (pull_data->metadata_objects_to_fetch);
|
||||||
g_source_set_callback (src, (GSourceFunc)on_metadata_objects_to_fetch_ready, pull_data, NULL);
|
g_source_set_callback (queue_src, (GSourceFunc)on_metadata_objects_to_fetch_ready, pull_data, NULL);
|
||||||
g_source_attach (src, NULL);
|
g_source_attach (queue_src, NULL);
|
||||||
g_source_unref (src);
|
g_source_unref (queue_src);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prime the message queue */
|
/* Prime the message queue */
|
||||||
@@ -1458,6 +1459,8 @@ ostree_pull (OstreeRepo *repo,
|
|||||||
g_free (pull_data->remote_name);
|
g_free (pull_data->remote_name);
|
||||||
if (pull_data->base_uri)
|
if (pull_data->base_uri)
|
||||||
soup_uri_free (pull_data->base_uri);
|
soup_uri_free (pull_data->base_uri);
|
||||||
|
if (queue_src)
|
||||||
|
g_source_destroy (queue_src);
|
||||||
if (pull_data->metadata_thread)
|
if (pull_data->metadata_thread)
|
||||||
{
|
{
|
||||||
ot_waitable_queue_push (pull_data->metadata_objects_to_scan,
|
ot_waitable_queue_push (pull_data->metadata_objects_to_scan,
|
||||||
|
|||||||
Reference in new issue
Block a user