Skip to content

Commit

Permalink
ui/sdl2: fix surface_gl_update_texture: Assertion 'gls' failed
Browse files Browse the repository at this point in the history
Before sdl2_gl_update() is called, sdl2_gl_switch() may decide to
destroy the console window and its associated shaders.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1644
Fixes: c84ab0a ("ui/console: optionally update after gfx switch")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Bin Meng <bin.meng@windriver.com>
Message-Id: <20230511074217.4171842-1-marcandre.lureau@redhat.com>
(cherry picked from commit b3a654d)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
elmarco authored and Michael Tokarev committed May 31, 2023
1 parent eef92fa commit e0baf24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ui/sdl2-gl.c
Expand Up @@ -67,6 +67,10 @@ void sdl2_gl_update(DisplayChangeListener *dcl,

assert(scon->opengl);

if (!scon->real_window) {
return;
}

SDL_GL_MakeCurrent(scon->real_window, scon->winctx);
surface_gl_update_texture(scon->gls, scon->surface, x, y, w, h);
scon->updates++;
Expand Down

0 comments on commit e0baf24

Please sign in to comment.