mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
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:
parent
5c6050f849
commit
bdbff3bc8e
2 changed files with 2 additions and 0 deletions
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue