mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
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
This commit is contained in:
parent
4863cfdf78
commit
d3b4961e16
@ -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());
|
theApp()->gui().unregisterView(id());
|
||||||
if (!theApp()->gui().viewIds().empty()) {
|
if (!theApp()->gui().viewIds().empty()) {
|
||||||
|
quitting = true;
|
||||||
// Just close the window and do nothing else if this is not the
|
// Just close the window and do nothing else if this is not the
|
||||||
// last window.
|
// last window.
|
||||||
close_event->accept();
|
close_event->accept();
|
||||||
|
Loading…
Reference in New Issue
Block a user