gstgtk: Don't leak the widget

g_object_get() returns a ref, gtk_container_add() only ref_sink().
That mean we still need to unref afterward. This leak was hiding
a reference bug previously present.
This commit is contained in:
Nicolas Dufresne 2015-06-11 12:38:53 -04:00
parent b14fea7fb8
commit 1f9bdcad87
2 changed files with 2 additions and 0 deletions

View file

@ -156,6 +156,7 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (window), area);
gtk_widget_realize (area);
g_object_unref (area);
caps = gst_caps_new_simple ("video/x-raw", "width", G_TYPE_INT, 640,
"height", G_TYPE_INT, 480, "format", G_TYPE_STRING, "RGBA",

View file

@ -142,6 +142,7 @@ main (int argc, char *argv[])
g_object_get (videosink, "widget", &area, NULL);
gtk_container_add (GTK_CONTAINER (window), area);
g_object_unref (area);
gtk_widget_realize (area);