SDL: Prevent SDL_FreeSurface from freeing the LCD buffer

In direct mode, the statically allocated Rockbox LCD framebuffer is used and should never be freed. Otherwise, ROCKBOX_VideoQuit takes care of freeing the dynamically allocated hidden buffer, used for scaling.

This fixed hanging of Rockbox when quitting an SDL app.

Change-Id: Ib9cd8c04cc0d2d6ccedaa582a5a85ef211d0273c
This commit is contained in:
Vencislav Atanasov 2025-07-25 20:16:26 +02:00
parent f27de46472
commit d40be8404b

View file

@ -643,6 +643,7 @@ SDL_Surface *ROCKBOX_SetVideoMode(_THIS, SDL_Surface *current,
this->hidden->h = current->h = height; this->hidden->h = current->h = height;
current->pitch = current->w * (bpp / 8); current->pitch = current->w * (bpp / 8);
current->pixels = this->hidden->direct ? lcd_fb : this->hidden->buffer; current->pixels = this->hidden->direct ? lcd_fb : this->hidden->buffer;
current->flags |= SDL_PREALLOC;
/* We're done */ /* We're done */
return(current); return(current);