From: Abdelrazak Younes Date: Fri, 23 May 2008 11:16:23 +0000 (+0000) Subject: Potential bug fix. X-Git-Tag: 1.6.10~4706 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5d32aace219a240cffd0f3ad0640429032b0492f;p=features.git Potential bug fix. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24907 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 509be19e20..9716d17fe0 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -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); + } } diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 3856e76280..fa8403d1ed 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -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(); }