Cannot move Rect

This post was flagged by the community and is temporarily hidden.

If you really are calling draw() only once, which ends up calling getTextRect only twice in total, then you shouldn’t see memory usage increase more and more the longer your program runs. If that’s the case then the memory leak is probably somewhere else.

If what you see is instead just that the memory usage does not drop down to near zero after calling cleanup() then I would not be too concerned about that. It’s pretty normal.

Holy I just realized I’m dumb - the one time it calls draw() is in a loop

Ah the memory usage stops if I bring it out the loop, but the rect doesnt move when I press s

Yeah, it most probably should be called from inside the loop.

Back to the question of how many times SDL_CreateTextureFromSurface gets called compared to SDL_DestroyTexture? Do you now see why this is a problem?

Yeah… I just fixed it thankfully though thanks for all your help :slight_smile: