mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 03:29:43 +00:00
ui/console: fix texture leak when calling surface_gl_create_texture()
Make surface_gl_create_texture() idempotent: if the surface is already bound to a texture, do not create a new one. This fixes texture leaks when there are multiple DBus listeners, for example. Reported-by: Akihiko Odaki <akihiko.odaki@gmail.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220214201337.1814787-3-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
a9fbce5e94
commit
6cdcf88107
@ -49,6 +49,10 @@ void surface_gl_create_texture(QemuGLShader *gls,
|
||||
assert(gls);
|
||||
assert(QEMU_IS_ALIGNED(surface_stride(surface), surface_bytes_per_pixel(surface)));
|
||||
|
||||
if (surface->texture) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (surface->format) {
|
||||
case PIXMAN_BE_b8g8r8x8:
|
||||
case PIXMAN_BE_b8g8r8a8:
|
||||
|
Loading…
Reference in New Issue
Block a user