From fcca4db1be57388bc25183eb7d3a3ff6cdde7979 Mon Sep 17 00:00:00 2001 From: scawful Date: Tue, 13 Aug 2024 18:06:10 -0400 Subject: [PATCH] fix sdl_deleter bug --- src/app/core/utils/sdl_deleter.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/core/utils/sdl_deleter.h b/src/app/core/utils/sdl_deleter.h index 31062595..3cd68d19 100644 --- a/src/app/core/utils/sdl_deleter.h +++ b/src/app/core/utils/sdl_deleter.h @@ -20,7 +20,7 @@ struct SDL_Deleter { */ struct SDL_Texture_Deleter { void operator()(SDL_Texture *p) const { - if (p) SDL_DestroyTexture(p); + if (p == nullptr) SDL_DestroyTexture(p); } }; @@ -30,7 +30,7 @@ struct SDL_Texture_Deleter { struct SDL_Surface_Deleter { void operator()(SDL_Surface *p) const { // Check if the surface is not null - if (p) SDL_FreeSurface(p); + if (p == nullptr) SDL_FreeSurface(p); } };