SDL_ttf memory leak

hi

i’ve just experimented a bit with the SDL_ttf 2.0.4 library, but when i
fired up the win2k task manager while running my prog, i discovered it
continued to allocate more RAM and never freed it.

when i comment the following block, the memory usage stays constant.

SDL_Rect dstrect;
SDL_Color forecol;
forecol.r = 0; forecol.g=0; forecol.b = 0;

SDL_Surface *text = TTF_RenderText_Solid(arial, “Hello world!!”,
forecol);
if(text != NULL)
{
dstrect.x = 400;
dstrect.y = i++;
dstrect.w = text->w;
dstrect.h = text->h;
SDL_BlitSurface(text, NULL, screen, &dstrect);
SDL_UpdateRect(screen,400,i-2,text->w,text->h);
SDL_FreeSurface(text);
}

that’s it. leaks about 16KB per second i’d say.
has anyone encountered this before? is it a bug in SDL_ttf or in the
Freetype library? most importantly, is there a fix?

thx
eik

ooops sorry mea culpa… my original code looked a bit different and i
found the bug. all my mistake, so no memory leak in SDL_ttf!!> i’ve just experimented a bit with the SDL_ttf 2.0.4 library, but when i

fired up the win2k task manager while running my prog, i discovered it
continued to allocate more RAM and never freed it.

when i comment the following block, the memory usage stays constant.

SDL_Rect dstrect;
SDL_Color forecol;
forecol.r = 0; forecol.g=0; forecol.b = 0;

SDL_Surface *text = TTF_RenderText_Solid(arial, “Hello world!!”,
forecol);
if(text != NULL)
{
dstrect.x = 400;
dstrect.y = i++;
dstrect.w = text->w;
dstrect.h = text->h;
SDL_BlitSurface(text, NULL, screen, &dstrect);
SDL_UpdateRect(screen,400,i-2,text->w,text->h);
SDL_FreeSurface(text);
}

that’s it. leaks about 16KB per second i’d say.
has anyone encountered this before? is it a bug in SDL_ttf or in the
Freetype library? most importantly, is there a fix?

thx
eik