From 1c5003c4ef04c6e7d2ede50547d9c98019a265f9 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 13 Aug 2008 14:25:56 +0000 Subject: [PATCH] Make sure that in_show_ is reset to false, even if an exception is thrown when we're trying to show a dialog. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26142 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 5a43273b81..aed3581a85 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -57,6 +57,7 @@ #include "support/lassert.h" #include "support/debug.h" +#include "support/ExceptionMessage.h" #include "support/FileName.h" #include "support/filetools.h" #include "support/gettext.h" @@ -2219,11 +2220,17 @@ void GuiView::showDialog(string const & name, string const & data, return; d.in_show_ = true; - Dialog * dialog = findOrBuild(name, false); - if (dialog) { - dialog->showData(data); - if (inset) - d.open_insets_[name] = inset; + try { + Dialog * dialog = findOrBuild(name, false); + if (dialog) { + dialog->showData(data); + if (inset) + d.open_insets_[name] = inset; + } + } + catch (ExceptionMessage const & ex) { + d.in_show_ = false; + throw ex; } d.in_show_ = false; }