From 7bc8cad9c20af6331b50e68657eb1f1559dfed71 Mon Sep 17 00:00:00 2001 From: BeWorld <36823759+BeWorld2018@users.noreply.github.com> Date: Sat, 28 Sep 2024 22:00:18 +0200 Subject: [PATCH] Fix MOS_DestroyWindowFramebuffer When FBOs using, DestroyWindowfRamebuffer call twice... fix SDL_Free call --- src/video/morphos/SDL_mosframebuffer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/video/morphos/SDL_mosframebuffer.c b/src/video/morphos/SDL_mosframebuffer.c index cf8fc5ae155f5..99318b91d185b 100644 --- a/src/video/morphos/SDL_mosframebuffer.c +++ b/src/video/morphos/SDL_mosframebuffer.c @@ -35,9 +35,10 @@ 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; } } @@ -45,6 +46,7 @@ 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;