Fixed the game breaking crash.

The objectmanager was not being closed/cleared in gameplaystate, thus
when you'd re-enter a few times it would crash because it reached that
enetities cap in the objectfactory.