From b1613273d026a60785030a8652b9c3dfeba6dc10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Thu, 2 May 2024 11:12:02 +0200 Subject: [PATCH] gst-plugin: Avoid GTK crash after context is destroyed It seems GTK continues using created contexts, so we cannot unref it here. Looking at GTK sink implementation for GtkVideo, I see that they do not unref it either, but since we use surfaceless context it would be probably better to have a static GstDisplay and reuse the same context in future. --- .../gst/plugin/handlers/gl/gstclapperglcontexthandler.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/gst/plugin/handlers/gl/gstclapperglcontexthandler.c b/src/lib/gst/plugin/handlers/gl/gstclapperglcontexthandler.c index 57b21fdb..652f8b73 100644 --- a/src/lib/gst/plugin/handlers/gl/gstclapperglcontexthandler.c +++ b/src/lib/gst/plugin/handlers/gl/gstclapperglcontexthandler.c @@ -473,7 +473,12 @@ gst_clapper_gl_context_handler_finalize (GObject *object) gst_clear_object (&self->gst_display); gst_clear_object (&self->wrapped_context); - gst_clear_object (&self->gst_context); + + /* FIXME: It seems GTK continues using created contexts, so we cannot unref + * it here. Looking at GTK sink implementation for GtkVideo, I see that they + * do not unref it either, but since we use surfaceless context it would be + * probably better to have a static GstDisplay and reuse the same context. */ + //gst_clear_object (&self->gst_context); GST_CALL_PARENT (G_OBJECT_CLASS, finalize, (object)); }