Fast load first time, much slower second time

Hello,

I'm experiencing an odd problem while coding my game: The first time a "GameState" is loaded, it's very fast (instantly). When I quit and go back to the menu and load the GameState class AGAIN, it's very slow (as in seconds slow).

What could possibly be the cause of this?

more info: States are singletons, so there exists exactly one instance of them. When a State is "popped", all its pointers are deleted so its basically empty. When it's loaded again they are allocated with the new operator.

It's quite a lot of code so I hope to find the cause without having to post multiple files.
check for the memory leak , static variable set , or global variable set ?
No memory leaks, no static variables and no globals :/
Topic archived. No new replies allowed.