Potential bug fix.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24907 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-05-23 11:16:23 +00:00
parent 85d944702f
commit 5d32aace21
2 changed files with 5 additions and 8 deletions

View File

@ -980,8 +980,10 @@ void GuiApplication::unregisterView(GuiView * gv)
{
LASSERT(d->views_[gv->id()] == gv, /**/);
d->views_.erase(gv->id());
if (current_view_ == gv)
if (current_view_ == gv) {
current_view_ = 0;
theLyXFunc().setLyXView(0);
}
}

View File

@ -342,10 +342,6 @@ GuiView::GuiView(int id)
GuiView::~GuiView()
{
if (guiApp->currentView() == this)
guiApp->setCurrentView(0);
theLyXFunc().setLyXView(0);
delete &d;
}
@ -427,8 +423,8 @@ void GuiView::closeEvent(QCloseEvent * close_event)
}
}
// Make sure that no LFUN use this close to be closed View.
theLyXFunc().setLyXView(0);
// Make sure that nothing will use this close to be closed View.
guiApp->unregisterView(this);
// Save toolbars configuration
if (isFullScreen()) {
@ -458,7 +454,6 @@ void GuiView::closeEvent(QCloseEvent * close_event)
it->second->saveSession();
}
guiApp->unregisterView(this);
close_event->accept();
}