On 2026/09/04 22:10, Marc-André Lureau wrote:
The dpy_gl_release_dmabuf callbacks in the GTK, SDL, egl-headless,
and spice backends call egl_dmabuf_release_texture(), which calls
glDeleteTextures(), without first making the owning GL context
current. This is reachable after another console's surface update
leaves EGL_NO_CONTEXT current (e.g. gd_egl_update clears the context
on return). The deletion then silently fails, leaking the GL texture
and its backing storage. With an unshared context current, a
coincident texture name could even be deleted from the wrong context.
Fix by making the appropriate GL context current in each backend's
release callback before calling egl_dmabuf_release_texture():
- GTK EGL: eglMakeCurrent with the VC's EGL context
- GTK GL Area: gtk_gl_area_make_current
- SDL: SDL_GL_MakeCurrent with the console's window context
- egl-headless: eglMakeCurrent with the render-node context
- spice: eglMakeCurrent with the render-node context
For GTK, the previously shared gd_gl_release_dmabuf is split into
backend-specific gd_egl_release_dmabuf and gd_gl_area_release_dmabuf,
matching the existing pattern where each backend manages its own
context.
Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Akihiko Odaki <[email protected]>
Regards,
Akihiko Odaki