all repos — mgba @ e21b4e3ee552bd2d2c8a3ebd95a5d9142fd478c6

mGBA Game Boy Advance Emulator

SDL: Move render context freeing to the right files
Jeffrey Pfau jeffrey@endrift.com
Wed, 18 Mar 2015 23:38:42 -0700
commit

e21b4e3ee552bd2d2c8a3ebd95a5d9142fd478c6

parent

2dd391046a3d2ac3f4a80978c3356ecec2b19295

3 files changed, 4 insertions(+), 4 deletions(-)

jump to
M src/platform/sdl/gl-sdl.csrc/platform/sdl/gl-sdl.c

@@ -160,5 +160,5 @@ }

} void GBASDLDeinit(struct SDLSoftwareRenderer* renderer) { - UNUSED(renderer); + free(renderer->d.outputBuffer); }
M src/platform/sdl/main.csrc/platform/sdl/main.c

@@ -143,8 +143,6 @@ return GBASDLInit(renderer);

} static void _GBASDLDeinit(struct SDLSoftwareRenderer* renderer) { - free(renderer->d.outputBuffer); - GBASDLDeinitEvents(&renderer->events); GBASDLDeinitAudio(&renderer->audio); #if SDL_VERSION_ATLEAST(2, 0, 0)
M src/platform/sdl/sw-sdl.csrc/platform/sdl/sw-sdl.c

@@ -123,7 +123,9 @@ }

} void GBASDLDeinit(struct SDLSoftwareRenderer* renderer) { - UNUSED(renderer); + if (renderer->ratio > 1) { + free(renderer->d.outputBuffer); + } #if !SDL_VERSION_ATLEAST(2, 0, 0) SDL_Surface* surface = SDL_GetVideoSurface(); SDL_UnlockSurface(surface);