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
This commit is contained in:
Richard Heck 2008-08-13 14:25:56 +00:00
parent 4d63bd347b
commit 1c5003c4ef

View File

@ -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;
}