mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-13 07:02:53 +00:00
gtkbasesink: Fix widget leak
gst_gtk_base_sink_get_widget() will increase refcount and it should
be released after use
Fixing regression introduced by the commit
941c0e81dd
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3650>
This commit is contained in:
parent
7cf130801b
commit
e2f30cd947
1 changed files with 8 additions and 2 deletions
|
@ -230,7 +230,8 @@ gst_gtk_base_sink_get_widget (GstGtkBaseSink * gtk_sink)
|
|||
|
||||
/* Take the floating ref, other wise the destruction of the container will
|
||||
* make this widget disappear possibly before we are done. */
|
||||
gst_object_ref_sink (gtk_sink->widget);
|
||||
g_object_ref_sink (gtk_sink->widget);
|
||||
|
||||
gtk_sink->widget_destroy_id = g_signal_connect (gtk_sink->widget, "destroy",
|
||||
G_CALLBACK (widget_destroy_cb), gtk_sink);
|
||||
|
||||
|
@ -341,6 +342,7 @@ gst_gtk_base_sink_navigation_send_event (GstNavigation * navigation,
|
|||
gst_structure_set (structure,
|
||||
"pointer_x", G_TYPE_DOUBLE, (gdouble) stream_x,
|
||||
"pointer_y", G_TYPE_DOUBLE, (gdouble) stream_y, NULL);
|
||||
g_object_unref (widget);
|
||||
}
|
||||
|
||||
event = gst_event_new_navigation (structure);
|
||||
|
@ -372,8 +374,10 @@ gst_gtk_base_sink_start_on_main (GstBaseSink * bsink)
|
|||
GstGtkBaseSink *gst_sink = GST_GTK_BASE_SINK (bsink);
|
||||
GstGtkBaseSinkClass *klass = GST_GTK_BASE_SINK_GET_CLASS (bsink);
|
||||
GtkWidget *toplevel;
|
||||
GtkGstBaseWidget *widget;
|
||||
|
||||
if (gst_gtk_base_sink_get_widget (gst_sink) == NULL) {
|
||||
widget = gst_gtk_base_sink_get_widget (gst_sink);
|
||||
if (!widget) {
|
||||
GST_ERROR_OBJECT (bsink, "Could not ensure GTK initialization.");
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -395,6 +399,8 @@ gst_gtk_base_sink_start_on_main (GstBaseSink * bsink)
|
|||
G_CALLBACK (window_destroy_cb), gst_sink);
|
||||
}
|
||||
|
||||
g_object_unref (widget);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue