Fixed crash when exiting game activity.