Fix (partly?) bug #6451: Crash when interacting with buffer-dependent dialog with no buffer open.

It seems to be a good idea to close all buffer-dependent dialogs when there are no more buffers open. This gives the user no opportunity to call buffer-related functions and cause a crash.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33015 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-01-13 20:25:17 +00:00
parent 23b672f83c
commit c37bef4127

View File

@ -3376,8 +3376,12 @@ void GuiView::updateDialogs()
for(; it != end; ++it) { for(; it != end; ++it) {
Dialog * dialog = it->second.get(); Dialog * dialog = it->second.get();
if (dialog && dialog->isVisibleView()) if (dialog) {
dialog->checkStatus(); if (dialog->isBufferDependent() && !documentBufferView())
hideDialog(fromqstr(dialog->name()), 0);
else if (dialog->isVisibleView())
dialog->checkStatus();
}
} }
updateToolbars(); updateToolbars();
updateLayoutList(); updateLayoutList();