d3dvideosink: hold class lock for entire duration of class destruction
authorAaron Boxer <aaron.boxer@collabora.com>
Sat, 7 Dec 2019 15:56:28 +0000 (09:56 -0600)
committerAaron Boxer <aaron.boxer@collabora.com>
Wed, 18 Dec 2019 18:15:06 +0000 (13:15 -0500)
This avoids a race condition currently when temporarily releasing the
lock and then re-acquiring.

sys/d3dvideosink/d3dvideosink.c

index 41647c0..0e353dd 100644 (file)
@@ -445,10 +445,13 @@ static gboolean
 gst_d3dvideosink_stop (GstBaseSink * bsink)
 {
   GstD3DVideoSink *sink = GST_D3DVIDEOSINK (bsink);
+  GstD3DVideoSinkClass *klass = GST_D3DVIDEOSINK_GET_CLASS (sink);
 
   GST_DEBUG_OBJECT (bsink, "Stop() called");
+  LOCK_CLASS (sink, klass);
   d3d_stop (sink);
   d3d_class_destroy (sink);
+  UNLOCK_CLASS (sink, klass);
 
   return TRUE;
 }