The bottom line is that some function allocates memory, but does not delete it. I also know that the problem is in the draw function of the Window class or in the functions that draw uses for itself.
The source code of possibly problematic functions I will post here, and the rest of the code on pastebin
void Window::draw(Object toDraw) { SDL_RenderCopy(coreRenderer, convertSurfaceToTexture(toDraw.getSurface(), coreRenderer), NULL, NULL); } SDL_Texture *convertSurfaceToTexture(SDL_Surface *image, SDL_Renderer *ren) { SDL_Texture *texture; texture = SDL_CreateTextureFromSurface(ren, image); if(texture == nullptr){ std::cout << "Ошибка конвертирования SDL_Surface в SDL_Texture: " << "\n\t" << SDL_GetError() << std::endl; exit(1); } return texture; } Since I have no reputation points, I’ll give you a link that will contain links -_-
