Your settings are saved when you close the project or the IDE, after asking you. Code::Blocks does not automatically overwrite files without asking, ever (except in case of a bug). I cannot imagine that Visual Studio does that, either. That would be a serious malfunction.
If your computer is unstable and you are afraid of losing data in a crash (I'm not seeing crashes any more often than maybe once in two months), use the autosave plugin, as pointed out by xunxun. This will take snapshots of your open files and your project file without overwriting the original data.