SDL: Move render context freeing to the right files

This commit is contained in:
Jeffrey Pfau 2015-03-18 23:38:42 -07:00
parent 2dd391046a
commit e21b4e3ee5
3 changed files with 4 additions and 4 deletions

View File

@ -160,5 +160,5 @@ void GBASDLRunloop(struct GBAThread* context, struct SDLSoftwareRenderer* render
}
void GBASDLDeinit(struct SDLSoftwareRenderer* renderer) {
UNUSED(renderer);
free(renderer->d.outputBuffer);
}

View File

@ -143,8 +143,6 @@ static bool _GBASDLInit(struct SDLSoftwareRenderer* renderer) {
}
static void _GBASDLDeinit(struct SDLSoftwareRenderer* renderer) {
free(renderer->d.outputBuffer);
GBASDLDeinitEvents(&renderer->events);
GBASDLDeinitAudio(&renderer->audio);
#if SDL_VERSION_ATLEAST(2, 0, 0)

View File

@ -123,7 +123,9 @@ void GBASDLRunloop(struct GBAThread* context, struct SDLSoftwareRenderer* render
}
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);