summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-09-04 14:43:31 +0100
committerJuan A. Suarez Romero <jasuarez@igalia.com>2015-09-06 16:13:54 +0200
commit19ff439107a1a338bcb52113bb1bd2612d2936d2 (patch)
tree468234a67386f2ee389c28b46ce5e91bcb8f4c65
parent2a1a58067c3f8ab8ff51ff1e02dc50c2bc2ecffe (diff)
downloadgrilo-plugins-19ff439107a1a338bcb52113bb1bd2612d2936d2.tar.gz
youtube: Fix an unpaired unref of a GCancellable when searching
The GCancellable stored in grl_operation_set_data() is unconditionally unreffed by release_operation_data(); but is also unconditionally unreffed elsewhere if it’s set as os->cancellable, so needs a second ref in the grl_operation_set_data() call to avoid a double-unref and crash. https://bugzilla.gnome.org/show_bug.cgi?id=754244
-rw-r--r--src/youtube/grl-youtube.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/youtube/grl-youtube.c b/src/youtube/grl-youtube.c
index 246c8a3..e085272 100644
--- a/src/youtube/grl-youtube.c
+++ b/src/youtube/grl-youtube.c
@@ -1071,7 +1071,7 @@ produce_from_feed (OperationSpec *os)
operation_spec_ref (os);
os->cancellable = g_cancellable_new ();
- grl_operation_set_data (os->operation_id, os->cancellable);
+ grl_operation_set_data (os->operation_id, g_object_ref (os->cancellable));
service = GRL_YOUTUBE_SOURCE (os->source)->priv->service;
@@ -1314,7 +1314,7 @@ grl_youtube_source_search (GrlSource *source,
/* Look for OPERATION_SPEC_REF_RATIONALE for details */
operation_spec_ref (os);
- grl_operation_set_data (ss->operation_id, os->cancellable);
+ grl_operation_set_data (ss->operation_id, g_object_ref (os->cancellable));
/* Index in GData starts at 1 */
query = gdata_youtube_query_new (ss->text);