ensure main game memory is freed up when exiting