From 0d565f7b350b4dfecfa9337b4b80173282d191ab Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 11 Jul 2017 15:28:06 +0200 Subject: [PATCH] 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. --- src/LyX.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/LyX.cpp b/src/LyX.cpp index bb88f82dbb..0a0a31959b 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -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) { -- 2.39.2