Destroy properties after applying them to avoid memory leakage

This commit is contained in:
r4nx 2024-03-11 03:06:42 +02:00 committed by Sam Lantinga
parent b5eb704fa8
commit feadbffb67
1 changed files with 1 additions and 0 deletions

View File

@ -1534,6 +1534,7 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s
SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER, surface->w);
SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER, surface->h);
texture = SDL_CreateTextureWithProperties(renderer, props);
SDL_DestroyProperties(props);
if (!texture) {
return NULL;
}