From acf517c422508829714e5a0b90e592deaef8c32c Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Fri, 11 Jun 2021 11:02:09 +0100 Subject: [PATCH] Fixed order of unlock/save --- src/uxnemu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uxnemu.c b/src/uxnemu.c index 4431a2c..4872186 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -93,8 +93,8 @@ save_screenshot(void) SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormat(0, w, h, 32, format); SDL_LockSurface(surface); SDL_RenderReadPixels(gRenderer, NULL, format, surface->pixels, surface->pitch); - SDL_UnlockSurface(surface); SDL_SaveBMP(surface, "screenshot.bmp"); + SDL_UnlockSurface(surface); SDL_FreeSurface(surface); }