When cleaning up before quitting, take care of exceptions

We do not want the cleanup work to be interrupted by a buffer exception.

Spotted by coverity. See bug #9979 for discussion.
This commit is contained in:
Jean-Marc Lasgouttes 2017-07-11 15:28:06 +02:00 committed by Jean-Marc Lasgouttes
parent fc75cbd88f
commit 0d565f7b35

View File

@ -419,8 +419,12 @@ void LyX::prepareExit()
// Write the index file of the converter cache
ConverterCache::get().writeIndex();
// close buffers first
pimpl_->buffer_list_.closeAll();
// closing buffer may throw exceptions, but we ignore them since we
// are quitting.
try {
// close buffers first
pimpl_->buffer_list_.closeAll();
} catch (ExceptionMessage const &) {}
// register session changes and shutdown server and socket
if (use_gui) {