Recently, I've asked in a code review if my code was causing any pointer related issues. They mentioned that I had problems with my dispose method. Basically, I'm disposing textures from a texture map, by cleaning the texture at the ID given to the method. So I would like to ask you if now, I'm disposing correctly my texture, and if there's a better way to do it.void TextureManager::freeTexture(std::string id){    std::map<std::string, SDL_Texture*>::iterator it = m_textureMap.find(id);    std::cout << Disposing texture : [ID== << id << ] [MemoryAdress== << it->second << ] : \n;    if (it == m_textureMap.end())    {        LOGERROR(ERROR : Invalid ID : cannot dispose texture);        return;    }    SDL_DestroyTexture(it->second);    std::cout << --> Destroyed !;    m_textureMap.erase(id);    std::cout <<  --> Erased from TextureMap !\n\n;}
C++ Disposing Textures
c++;memory management;sdl