]> git.lyx.org Git - features.git/commitdiff
Potential bug fix.
authorAbdelrazak Younes <younes@lyx.org>
Fri, 23 May 2008 11:16:23 +0000 (11:16 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 23 May 2008 11:16:23 +0000 (11:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24907 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiView.cpp

index 509be19e20f782e51e5199aab6843421b09831d7..9716d17fe0ff33303bb1c548e60edc9cab0f1d86 100644 (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);
+       }
 }
 
 
index 3856e762803b68a13b5a92286e4d091d7f081dfc..fa8403d1edbaa47c6256b955f90a6147cc9c6119 100644 (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();
 }