It has always done this for me, on 3 computers I've used Ubuntu with, with several different kernels. E.g. I can open a new document in LibreOffice, write some text, then choose "Power off" or "Restart" and the machine instantly shuts down (like holding the power button in). Isn't it supposed to prompt you to save unsaved work first?
Something similar was asked several years ago, and apparently the answer is "yes", at least for some apps, but it still doesn't do it for me with any app - including the ones that ship with Ubuntu. I can shutdown Ubuntu system without closing all running programs.I think this should not happens