Hello! I am currently using MS Visual Studio 2010 and started working on a project. However in debug mode everything works just fine, but as soon as i switch to Release mode i get some problems. I have made sure that it isn't any optimizer problem since i diabled full program optimization (just to be sure). The problem occured when i introduced a new feature into my program. In debug mode the program runs just fine. But when i switch to release mode the program exist instantaneously with no signs of error. I managed to narrow it down to a variable that get's changed after some two function calls.
The problem occurs as soon as window.draw(*player.getSprite()); and player.stepAnimation(); are called. The variable isQuitting gets switched from false to true even though those function calls have nothing to do with it, neither do they have acces. I tried commenting one of the functions out but leaving the other, no change. Only when i comment both of them out the variable stays unchanged.
the window object is an sf::RenderWindow from the SFML 2.0 library.
the function call of player.stepAnimation(); occurs in its derived class Moveable
I think that it is some sort of memory corruption or buffer overflow, but i can't seem to figure out where. Sometimes it is easier to spot errors on someone elses code. Thanks!
I'll fix the destructor, and no, there is no need for dynamic allocation. I tried changing it to dynamic allocation to see if anything changed, and it didn't.