Hey there, got a problem in some code, I saw that I had a mem leak (using Task Manager), and when I started looking everywhere by commenting 99% of my code I saw that the mem leak was supposed to be in this part of code :
void RectGrid::DrawGrid(sf::RenderWindow *window) {
sf::Sprite RectSprite = *new sf::Sprite();
RectSprite.setTexture(*RectTexture);
for (int x = 0; x < grid.size(); x++) {
for (int y = 0; y < grid.at(x).size(); y++) {
window->draw(RectSprite);
}
}
}
RectTexture is nothing more than an sf::Texture* and grid is an std::vector<std::vector<RectType>> where RectTypeis an enum. window is a pointer on an sf::RenderWindow.
I really don't understand what I have done wrong in this code...