Memory leak fixes

This pull request fixes some memory leaks:

After starting a game and returning to the main menu the memory usage reported by the Eclipse Memory Analyzer was about 80 MB. With this fixes the reported memory usage in the same situation is now about 12 MB.