fix sdl_deleter bug

This commit is contained in:
scawful
2024-08-13 18:06:10 -04:00
parent 347a16666c
commit fcca4db1be

View File

@@ -20,7 +20,7 @@ struct SDL_Deleter {
*/ */
struct SDL_Texture_Deleter { struct SDL_Texture_Deleter {
void operator()(SDL_Texture *p) const { 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 { struct SDL_Surface_Deleter {
void operator()(SDL_Surface *p) const { void operator()(SDL_Surface *p) const {
// Check if the surface is not null // Check if the surface is not null
if (p) SDL_FreeSurface(p); if (p == nullptr) SDL_FreeSurface(p);
} }
}; };