From 39cbe25df76eb01bc46ec89e7822ca958d09595c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 24 Oct 2014 17:49:23 +0100 Subject: [PATCH] gio: don't use soon-to-be-deprecated g_cancellable_reset() From the API documentation: "Note that it is generally not a good idea to reuse an existing cancellable for more operations after it has been cancelled once, as this function might tempt you to do. The recommended practice is to drop the reference to a cancellable after cancelling it, and let it die with the outstanding async operations. You should create a fresh cancellable for further async operations." https://bugzilla.gnome.org/show_bug.cgi?id=739132 --- gst/gio/gstgiobasesink.c | 3 ++- gst/gio/gstgiobasesrc.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/gio/gstgiobasesink.c b/gst/gio/gstgiobasesink.c index d50e8aab18..3dbec56bbf 100644 --- a/gst/gio/gstgiobasesink.c +++ b/gst/gio/gstgiobasesink.c @@ -191,7 +191,8 @@ gst_gio_base_sink_unlock_stop (GstBaseSink * base_sink) GST_LOG_OBJECT (sink, "resetting cancellable"); - g_cancellable_reset (sink->cancel); + g_object_unref (sink->cancel); + sink->cancel = g_cancellable_new (); return TRUE; } diff --git a/gst/gio/gstgiobasesrc.c b/gst/gio/gstgiobasesrc.c index 0ffe01abe3..213ede670b 100644 --- a/gst/gio/gstgiobasesrc.c +++ b/gst/gio/gstgiobasesrc.c @@ -286,7 +286,8 @@ gst_gio_base_src_unlock_stop (GstBaseSrc * base_src) GST_LOG_OBJECT (src, "resetting cancellable"); - g_cancellable_reset (src->cancel); + g_object_unref (src->cancel); + src->cancel = g_cancellable_new (); return TRUE; }