Merge branch 'wip/dont-leak-egl-surface' into 'main'

gdk/surface: Don't leak the EGLSurface

See merge request GNOME/gtk!7568
This commit is contained in:
Matthias Clasen 2024-08-06 22:54:31 +00:00
commit 31b655c9eb
2 changed files with 4 additions and 1 deletions

View File

@ -1132,8 +1132,10 @@ gdk_surface_set_egl_native_window (GdkSurface *self,
if (priv->egl_surface != NULL)
{
GdkDisplay *display = gdk_surface_get_display (self);
gdk_gl_context_clear_current_if_surface (self);
eglDestroySurface (gdk_surface_get_display (self), priv->egl_surface);
eglDestroySurface (gdk_display_get_egl_display (display), priv->egl_surface);
priv->egl_surface = NULL;
}

View File

@ -20,6 +20,7 @@
#include "gdk/gdkglcontextprivate.h"
#ifdef HAVE_DMABUF
#include <glib-unix.h>
#include <linux/dma-buf.h>
#endif