When trying to shutdown kde (4.1), it did not exit, for no obvious reason. Eventually I clicked on the 'lyx' icon on the panel, and it was giving the 'save/discard' dialog.
It did not seem to have raised this dialog, so I didn't notice it. Not very friendly behavior - and AFAIK the only app I've used that does this.