tcp: don't use soon-to-be-deprecated g_cancellable_reset()
authorTim-Philipp Müller <tim@centricular.com>
Fri, 24 Oct 2014 16:48:54 +0000 (17:48 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 19 May 2015 17:50:41 +0000 (18:50 +0100)
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/tcp/gstmultioutputsink.c
gst/tcp/gstmultisocketsink.c
gst/tcp/gsttcpclientsink.c
gst/tcp/gsttcpclientsrc.c
gst/tcp/gsttcpserversrc.c

index 89f7e59..205a3a8 100644 (file)
@@ -2786,7 +2786,8 @@ gst_multi_output_sink_unlock_stop (GstBaseSink * bsink)
   sink = GST_MULTI_OUTPUT_SINK (bsink);
 
   GST_DEBUG_OBJECT (sink, "unset flushing");
-  g_cancellable_reset (sink->cancellable);
+  g_object_unref (sink->cancellable);
+  sink->cancellable = g_cancellable_new ();
 
   return TRUE;
 }
index aed9808..bc4e231 100644 (file)
@@ -1172,7 +1172,8 @@ gst_multi_socket_sink_unlock_stop (GstBaseSink * bsink)
   sink = GST_MULTI_SOCKET_SINK (bsink);
 
   GST_DEBUG_OBJECT (sink, "unset flushing");
-  g_cancellable_reset (sink->cancellable);
+  g_object_unref (sink->cancellable);
+  sink->cancellable = g_cancellable_new ();
 
   return TRUE;
 }
index 65a9d01..d23ded4 100644 (file)
@@ -419,7 +419,8 @@ gst_tcp_client_sink_unlock_stop (GstBaseSink * bsink)
   GstTCPClientSink *sink = GST_TCP_CLIENT_SINK (bsink);
 
   GST_DEBUG_OBJECT (sink, "unset flushing");
-  g_cancellable_reset (sink->cancellable);
+  g_object_unref (sink->cancellable);
+  sink->cancellable = g_cancellable_new ();
 
   return TRUE;
 }
index 2207563..776ff42 100644 (file)
@@ -485,7 +485,8 @@ gst_tcp_client_src_unlock_stop (GstBaseSrc * bsrc)
   GstTCPClientSrc *src = GST_TCP_CLIENT_SRC (bsrc);
 
   GST_DEBUG_OBJECT (src, "unset flushing");
-  g_cancellable_reset (src->cancellable);
+  g_object_unref (src->cancellable);
+  src->cancellable = g_cancellable_new ();
 
   return TRUE;
 }
index 9cd6ad6..72efb86 100644 (file)
@@ -559,7 +559,8 @@ gst_tcp_server_src_unlock_stop (GstBaseSrc * bsrc)
 {
   GstTCPServerSrc *src = GST_TCP_SERVER_SRC (bsrc);
 
-  g_cancellable_reset (src->cancellable);
+  g_object_unref (src->cancellable);
+  src->cancellable = g_cancellable_new ();
 
   return TRUE;
 }