I have compiled Code::Blocks under Linux only 3 times, and 1 under FreeBSD. The first compilation, that was a long time ago (the project was still on CVS), always crashed on exit, like a last millisecond crash before it could finish exiting. A few days ago I compiled Code::Blocks again but didn't test it that much, even though I don't remember it crashing. Compiled a more recent version and the crashing is back.
The FreeBSD one, on the other hand, was the same version as the first I compiled for Linux, and it didn't crash.
Sometimes those crashes are caused by a plugin, so I'd recommend to disable all the plugins and quit Code::Blocks. Open it again, close it. Did it crash? If it didn't, open it, enable a plugin. Close it. Open it again and close it. Did it crash? If it didn't, open it, enable another plugin. Close it. And so on.
If you find it crashes when you enable a specific plugin, try the same with only that plugin enabled. If it keeps crashing with just that plugin then we got something.
I'd test it myself but right now I must go.