From: Asger Ottar Alstrup Date: Fri, 20 Oct 2006 08:42:16 +0000 (+0000) Subject: - Fix crash on closing a document where for instance the PDF is still open (temp... X-Git-Tag: 1.6.10~12330 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2a887391ffa136e50965b3450e37cd47174c4a91;p=features.git - Fix crash on closing a document where for instance the PDF is still open (temp directory can not be removed when another program has an open file there) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15391 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/support/filetools.C b/src/support/filetools.C index 5259f4090c..c2d5453aef 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -390,7 +390,12 @@ string const createTmpDir(string const & tempdir, string const & mask) bool destroyDir(string const & tmpdir) { - return fs::remove_all(tmpdir) > 0; + try { + return fs::remove_all(tmpdir) > 0; + } catch (fs::filesystem_error const & fe){ + lyxerr << "Could not delete " << tmpdir << ". (" << fe.what() << ")" << std::endl; + return false; + } }