Mac OS 10.5 Leopard sudden logout/login

BIZARRE. Just now, I was working in the following applications: Excel, Preview, Aperture, Photo Mechanic, and iTunes (playing music). I clicked over from Excel to Photo Mechanic, and my Mac Pro screen went completely blue. Finder re-launched, and it was like I had just logged in after a restart. Obviously, I lost all my work since the last save. It's the first time anything like this has happened. Scary (and shitty).

(I used to get kernel panics during the early days of Parallels -- thankfully, those days are over.)

OK, so now the few of my friends still on Windows are going to chime in and tell me to use Vista. No.