From 40dd6a1b08bf673558a1493dfe1edca2b35d33c1 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Thu, 6 Dec 2007 18:52:17 +0000 Subject: [PATCH] Shutdown LyX server and socket before trying to remove the tempdir, otherwise it would not be empty and could not be removed. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21992 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/LyX.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/LyX.cpp b/src/LyX.cpp index 895cbcbfb6..db9e92033a 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -471,6 +471,15 @@ void LyX::prepareExit() // close buffers first pimpl_->buffer_list_.closeAll(); + // register session changes and shutdown server and socket + if (use_gui) { + if (pimpl_->session_) + pimpl_->session_->writeFile(); + pimpl_->session_.reset(); + pimpl_->lyx_server_.reset(); + pimpl_->lyx_socket_.reset(); + } + // do any other cleanup procedures now if (package().temp_dir() != package().system_temp_dir()) { LYXERR(Debug::INFO, "Deleting tmp dir " @@ -484,14 +493,6 @@ void LyX::prepareExit() } } - if (use_gui) { - if (pimpl_->session_) - pimpl_->session_->writeFile(); - pimpl_->session_.reset(); - pimpl_->lyx_server_.reset(); - pimpl_->lyx_socket_.reset(); - } - // Kill the application object before exiting. This avoids crashes // when exiting on Linux. if (pimpl_->application_)