My RubyMine (and it seems like many other Java GUI applications) crashes the Compiz window decorator almost every time on exit. This also seems to happen for the Unity decorator.
Update: The commited fix from below seems to have made it into the stable Ubuntu repository.
Easy mode
You can restore window decorations by executing this command:
gtk-window-decorator --replace &
This is only a temporary fix.
Hard mode
Also, there is a committed fix Show archive.org snapshot that is not yet in the stable repository. You can enable the testing sources (natty-proposed) Show archive.org snapshot and update your packages to get the fix.
You will also receive lots of other code in testing, so hold on to something. This can be avoided by
restricting
Show archive.org snapshot
it to the compiz
package (I did not test this).
Warning: Your system may enter an unstable state!