examples/gl: unref bus and element after usage
authorSebastian Rasmussen <sebras@hotmail.com>
Sat, 9 Aug 2014 09:45:41 +0000 (11:45 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:45 +0000 (19:31 +0000)
gst_pipeline_get_bus() and gst_bin_get_by_interface() both
return references that need to be unreferenced after usage.

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

tests/examples/gl/clutter/clutteractor.c
tests/examples/gl/clutter/clutteractortee.c
tests/examples/gl/gtk/fxtest/fxtest.c

index 1fcae0e..3bcd4b0 100644 (file)
@@ -164,6 +164,7 @@ main (int argc, char *argv[])
 
   gst_bus_set_sync_handler (bus, (GstBusSyncHandler) create_window, actor,
       NULL);
+  gst_object_unref (bus);
 
   gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
 
index 73f7a60..b05020f 100644 (file)
@@ -217,6 +217,7 @@ main (int argc, char *argv[])
 
   gst_bus_set_sync_handler (bus, (GstBusSyncHandler) create_window, actor,
       NULL);
+  gst_object_unref (bus);
 
   gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
 
index a9b41c1..0444f5c 100644 (file)
@@ -42,6 +42,7 @@ expose_cb (GtkWidget * widget, gpointer data)
           GST_TYPE_VIDEO_OVERLAY));
 
   gst_video_overlay_set_gtk_window (overlay, widget);
+  gst_object_unref (overlay);
 
   return FALSE;
 }