summaryrefslogtreecommitdiff
path: root/src/local-metadata
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2015-07-17 16:45:12 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2015-07-17 16:45:12 +0100
commit67ea3ac1f7e9aa754fbaf33b25b999dc39073767 (patch)
treef21faac0b6fce8c0c60fe2f0253e7bd22b853791 /src/local-metadata
parentb5a05ec50b5513d084e0a14d407c55b645f4bc22 (diff)
downloadgrilo-plugins-67ea3ac1f7e9aa754fbaf33b25b999dc39073767.tar.gz
local-metadata: only free cancellable when operation finishes
resolve_album_art() already used this technique, but resolve_image() was relying on releasing an implicit reference in got_file_info() around the time it finished the operation, which is not going to work well if we want to chain additional sub-operations that share a cancellable. Bug: https://bugzilla.gnome.org/show_bug.cgi?id=752437
Diffstat (limited to 'src/local-metadata')
-rw-r--r--src/local-metadata/grl-local-metadata.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/local-metadata/grl-local-metadata.c b/src/local-metadata/grl-local-metadata.c
index f0e6e92..632aa7f 100644
--- a/src/local-metadata/grl-local-metadata.c
+++ b/src/local-metadata/grl-local-metadata.c
@@ -668,7 +668,6 @@ got_file_info (GFile *file,
extract_gibest_hash_async (resolve_data, file, cancellable);
} else {
resolve_data_finish_operation (resolve_data, "image", NULL);
- g_clear_object (&cancellable);
}
goto exit;
@@ -684,7 +683,6 @@ error:
g_error_free (error);
g_error_free (new_error);
}
- g_clear_object (&cancellable);
exit:
g_clear_object (&info);
@@ -818,7 +816,10 @@ resolve_image (ResolveData *resolve_data,
file = g_file_new_for_uri (grl_media_get_url (resolve_data->rs->media));
cancellable = g_cancellable_new ();
- grl_operation_set_data (resolve_data->rs->operation_id, cancellable);
+ /* The operation owns the cancellable */
+ grl_operation_set_data_full (resolve_data->rs->operation_id,
+ cancellable,
+ (GDestroyNotify) g_object_unref);
#if GLIB_CHECK_VERSION (2, 39, 0)
attributes = G_FILE_ATTRIBUTE_THUMBNAIL_PATH "," \