exit_status = pimpl_->application_->exec();
else if (!pimpl_->files_to_load_.empty()) {
vector<string>::const_iterator it = pimpl_->files_to_load_.begin();
exit_status = pimpl_->application_->exec();
else if (!pimpl_->files_to_load_.empty()) {
vector<string>::const_iterator it = pimpl_->files_to_load_.begin();
- // 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 &) {}
// do any other cleanup procedures now
if (package().temp_dir() != package().system_temp_dir()) {
string const abs_tmpdir = package().temp_dir().absFileName();
// do any other cleanup procedures now
if (package().temp_dir() != package().system_temp_dir()) {
string const abs_tmpdir = package().temp_dir().absFileName();
docstring const msg =
bformat(_("%1$s does not appear like a LyX created temporary directory."),
from_utf8(abs_tmpdir));
Alert::warning(_("Cannot remove temporary directory"), msg);
} else {
docstring const msg =
bformat(_("%1$s does not appear like a LyX created temporary directory."),
from_utf8(abs_tmpdir));
Alert::warning(_("Cannot remove temporary directory"), msg);
} else {
if (!package().temp_dir().destroyDirectory()) {
LYXERR0(bformat(_("Unable to remove the temporary directory %1$s"),
if (!package().temp_dir().destroyDirectory()) {
LYXERR0(bformat(_("Unable to remove the temporary directory %1$s"),
// if they were not named on the command line. We do not want to dispatch to
// those.
vector<Buffer *> command_line_buffers;
// if they were not named on the command line. We do not want to dispatch to
// those.
vector<Buffer *> command_line_buffers;
if (lyxrc.example_path.empty()) {
lyxrc.example_path = addPath(package().system_support().absFileName(),
if (lyxrc.example_path.empty()) {
lyxrc.example_path = addPath(package().system_support().absFileName(),
|| configFileNeedsUpdate("lyxmodules.lst")
|| configFileNeedsUpdate("textclass.lst")
|| configFileNeedsUpdate("packages.lst")
|| configFileNeedsUpdate("lyxmodules.lst")
|| configFileNeedsUpdate("textclass.lst")
|| configFileNeedsUpdate("packages.lst")
" where fmt is the export format of choice. Look in\n"
" Tools->Preferences->File Handling->File Formats->Short Name\n"
" to see which parameter (which differs from the format name\n"
" where fmt is the export format of choice. Look in\n"
" Tools->Preferences->File Handling->File Formats->Short Name\n"
" to see which parameter (which differs from the format name\n"
" Note that the order of -e and -x switches matters.\n"
"\t-E [--export-to] fmt filename\n"
" where fmt is the export format of choice (see --export),\n"
" Note that the order of -e and -x switches matters.\n"
"\t-E [--export-to] fmt filename\n"
" where fmt is the export format of choice (see --export),\n"