mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-17 22:06:41 +00:00
gtkglsink: Don't leak vertex array and buffers
This is now possible since reset is always called from the main thread. https://bugzilla.gnome.org/show_bug.cgi?id=752441
This commit is contained in:
parent
410ffd5c62
commit
5e87b9f9af
1 changed files with 21 additions and 1 deletions
|
@ -360,6 +360,26 @@ _reset (GtkGstBaseWidget * base_widget)
|
|||
!base_widget->ignore_alpha);
|
||||
}
|
||||
|
||||
/* called from main thread */
|
||||
static void
|
||||
gtk_gst_gl_widget_reset (GtkGstBaseWidget * base_widget)
|
||||
{
|
||||
GtkGstGLWidgetPrivate *priv = GTK_GST_GL_WIDGET (base_widget)->priv;
|
||||
const GstGLFuncs *gl = priv->other_context->gl_vtable;
|
||||
|
||||
_reset (base_widget);
|
||||
|
||||
if (priv->vao) {
|
||||
gl->DeleteVertexArrays (1, &priv->vao);
|
||||
priv->vao = 0;
|
||||
}
|
||||
|
||||
if (priv->vertex_buffer) {
|
||||
gl->DeleteBuffers (1, &priv->vertex_buffer);
|
||||
priv->vertex_buffer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_gst_gl_widget_finalize (GObject * object)
|
||||
{
|
||||
|
@ -393,7 +413,7 @@ gtk_gst_gl_widget_class_init (GtkGstGLWidgetClass * klass)
|
|||
|
||||
gobject_klass->finalize = gtk_gst_gl_widget_finalize;
|
||||
gl_widget_klass->render = gtk_gst_gl_widget_render;
|
||||
base_widget_klass->reset = _reset;
|
||||
base_widget_klass->reset = gtk_gst_gl_widget_reset;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue