Parcourir la source

Destroy properties after applying them to avoid memory leakage

r4nx il y a 1 an
Parent
commit
feadbffb67
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      src/render/SDL_render.c

+ 1 - 0
src/render/SDL_render.c

@@ -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;
     }