From d3b4961e16e4ea631bde01ac03d040a375d70467 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Tue, 17 Jul 2007 09:21:52 +0000 Subject: [PATCH] With or without multiview, a crash can happen randomly if the statusbar timer times out after the view is closed. Two reason for that: 1) LyXFunc::lyx_view_ is not set to 0 2) quiting is not set to true. This patch add safe guards when closing a view and/or exiting. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19095 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index a3073d4833..acbab7d2c2 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -288,8 +288,14 @@ void GuiView::closeEvent(QCloseEvent * close_event) } } + // Make sure that no LFUN use this close to be closed View. + theLyXFunc().setLyXView(0); + // Make sure the timer time out will not trigger a statusbar update. + statusbar_timer_.stop(); + theApp()->gui().unregisterView(id()); if (!theApp()->gui().viewIds().empty()) { + quitting = true; // Just close the window and do nothing else if this is not the // last window. close_event->accept(); -- 2.39.2