From 007a00b7f13a8773f24e1fe8d8817dce3660f962 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 7 Mar 2016 15:12:00 +0100 Subject: [PATCH] + bug fix similar to idea of pull request 111 --- src/App/Application.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 9053b6acbeef..969fe41ce2a2 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -443,10 +443,15 @@ Document* Application::openDocument(const char * FileName) newDoc->FileName.setValue(File.filePath()); - // read the document - newDoc->restore(); - - return newDoc; + try { + // read the document + newDoc->restore(); + return newDoc; + } + catch (...) { + closeDocument(newDoc->getName()); + throw; + } } Document* Application::getActiveDocument(void) const