Skip to content

Commit

Permalink
Fix MOS_DestroyWindowFramebuffer
Browse files Browse the repository at this point in the history
When FBOs using, DestroyWindowfRamebuffer call twice... fix SDL_Free call
  • Loading branch information
BeWorld2018 committed Sep 28, 2024
1 parent 714a8a0 commit 7bc8cad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/video/morphos/SDL_mosframebuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,18 @@ void
MOS_DestroyWindowFramebuffer(_THIS, SDL_Window * window)
{
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;

if (data) {
if (data->fb) {
D("[%s]\n", __FUNCTION__);
SDL_free(data->fb);
data->fb = NULL;
}
}

int
MOS_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format,
void ** pixels, int *pitch)
{
D("[%s]\n", __FUNCTION__);
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
SDL_VideoData *vd = data->videodata;
SDL_Framebuffer *fb;
Expand Down

0 comments on commit 7bc8cad

Please sign in to comment.