/* 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);
gtk_gst_base_widget_display_size_to_stream_size (widget,
x, y, &stream_x, &stream_y);
gst_navigation_event_set_coordinates (event, stream_x, stream_y);
+ g_object_unref (widget);
}
pad = gst_pad_get_peer (GST_VIDEO_SINK_PAD (sink));
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;
}
G_CALLBACK (window_destroy_cb), gst_sink);
}
+ g_object_unref (widget);
+
return TRUE;
}