possible fix for some errors with vector, and fixed ARC_Text_SetString memory leak

This commit is contained in:
herbglitch 2023-08-26 01:36:22 +00:00
parent 1450bb7c86
commit bb67a87451
2 changed files with 11 additions and 1 deletions

View file

@ -32,6 +32,9 @@ void ARC_Text_SetString(ARC_Text *text, ARC_Renderer *renderer, ARC_String *stri
text->bounds.w = surface->w;
text->bounds.h = surface->h;
if(text->texture){
SDL_DestroyTexture(text->texture);
}
text->texture = SDL_CreateTextureFromSurface((SDL_Renderer *)renderer, surface);
SDL_FreeSurface(surface);