SDL: Only unreference pixman buffers when necessary

This commit is contained in:
Cameron Cawley 2018-11-29 21:45:11 +00:00 committed by endrift
parent d8c3236c85
commit bc9dff00da
1 changed files with 4 additions and 4 deletions

View File

@ -108,11 +108,11 @@ void mSDLSWRunloop(struct mSDLRenderer* renderer, void* user) {
void mSDLSWDeinit(struct mSDLRenderer* renderer) { void mSDLSWDeinit(struct mSDLRenderer* renderer) {
if (renderer->ratio > 1) { if (renderer->ratio > 1) {
free(renderer->outputBuffer); free(renderer->outputBuffer);
#ifdef USE_PIXMAN
pixman_image_unref(renderer->pix);
pixman_image_unref(renderer->screenpix);
#endif
} }
SDL_Surface* surface = SDL_GetVideoSurface(); SDL_Surface* surface = SDL_GetVideoSurface();
SDL_UnlockSurface(surface); SDL_UnlockSurface(surface);
#ifdef USE_PIXMAN
pixman_image_unref(renderer->pix);
pixman_image_unref(renderer->screenpix);
#endif
} }