The advice thing to do in this case used to be to destroy enemy governments and repair your own, if you built it. However, if the AI has damaged your government and spawned a government, destroying theirs and repairing your own can result in an end turn CTD. I rarely loose settlments, but when I do, I just tear down all government buildings and start over from scratch to avoid any chance of this crash. (If you do encounter this crash, once you restart the game, and if you start from the autosave [or some save after the point you destroyed all but your own government], ending turn should work fine this time.)