GstGtkGLSink: fix possible warning in finalize
authorXavier Claessens <xavier.claessens@collabora.com>
Tue, 16 Jun 2015 20:21:26 +0000 (16:21 -0400)
committerMatthew Waters <matthew@centricular.com>
Thu, 9 Jul 2015 06:40:19 +0000 (16:40 +1000)
If the element is finalized before going in READY state
the widget could still be NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=751104

ext/gtk/gstgtkglsink.c

index 2a77aec..cee44ba 100644 (file)
@@ -156,7 +156,7 @@ gst_gtk_gl_sink_finalize (GObject * object)
 {
   GstGtkGLSink *gtk_sink = GST_GTK_GL_SINK (object);;
 
-  g_object_unref (gtk_sink->widget);
+  g_clear_object (&gtk_sink->widget);
 
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }