commit 3d3134616d7c8cadaf921971973a387a1b9d7a33 parent 8dcaa274e8e4b84231ddffaab33f86d52aa96262 Author: Martin Stransky <stransky@redhat.com> Date: Mon, 1 Dec 2025 09:21:34 +0000 Bug 1997607 [Linux] Make GL context current to delete textures r=emilio Differential Revision: https://phabricator.services.mozilla.com/D274248 Diffstat:
| M | widget/gtk/DMABufSurface.cpp | | | 8 | +++++--- |
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp @@ -1209,14 +1209,16 @@ void DMABufSurfaceRGBA::ReleaseTextures() { #endif } - if (mTexture) { + const auto& gle = gl::GLContextEGL::Cast(mGL); + const auto& egl = gle->mEgl; + + if (mTexture && mGL->MakeCurrent()) { mGL->fDeleteTextures(1, &mTexture); mTexture = 0; } if (mEGLImage != LOCAL_EGL_NO_IMAGE) { - const auto& gle = gl::GLContextEGL::Cast(mGL); - gle->mEgl->fDestroyImage(mEGLImage); + egl->fDestroyImage(mEGLImage); mEGLImage = LOCAL_EGL_NO_IMAGE; } mGL = nullptr;