mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Fix some crashes on exit and on windows switch.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20680 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9b223c494e
commit
1fe543fcd5
@ -80,8 +80,6 @@ LyXView::LyXView(int id)
|
||||
|
||||
LyXView::~LyXView()
|
||||
{
|
||||
disconnectBuffer();
|
||||
disconnectBufferView();
|
||||
delete dialogs_;
|
||||
delete autosave_timeout_;
|
||||
}
|
||||
|
@ -47,9 +47,6 @@ void WorkAreaManager::redrawAll()
|
||||
|
||||
void WorkAreaManager::closeAll()
|
||||
{
|
||||
if (quitting)
|
||||
return;
|
||||
|
||||
while (!work_areas_.empty())
|
||||
// WorkArea is de-registering itself.
|
||||
(*work_areas_.begin())->close();
|
||||
|
@ -294,10 +294,10 @@ GuiViewBase::~GuiViewBase()
|
||||
void GuiViewBase::close()
|
||||
{
|
||||
quitting_by_menu_ = true;
|
||||
for (int i = 0; i != d.tab_widget_->count(); ++i) {
|
||||
GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(d.tab_widget_->widget(i));
|
||||
while (d.tab_widget_->count()) {
|
||||
GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(d.tab_widget_->widget(0));
|
||||
BOOST_ASSERT(wa);
|
||||
d.tab_widget_->removeTab(i);
|
||||
d.tab_widget_->removeTab(0);
|
||||
delete wa;
|
||||
}
|
||||
QMainWindow::close();
|
||||
@ -722,7 +722,6 @@ bool GuiViewBase::event(QEvent * e)
|
||||
switch (e->type())
|
||||
{
|
||||
// Useful debug code:
|
||||
//case QEvent::WindowActivate:
|
||||
//case QEvent::ActivationChange:
|
||||
//case QEvent::WindowDeactivate:
|
||||
//case QEvent::Paint:
|
||||
@ -737,6 +736,15 @@ bool GuiViewBase::event(QEvent * e)
|
||||
//case QEvent::Drop:
|
||||
// break;
|
||||
|
||||
case QEvent::WindowActivate: {
|
||||
GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(d.tab_widget_->currentWidget());
|
||||
BOOST_ASSERT(wa);
|
||||
BufferView & bv = wa->bufferView();
|
||||
connectBufferView(bv);
|
||||
connectBuffer(bv.buffer());
|
||||
return QMainWindow::event(e);
|
||||
}
|
||||
|
||||
case QEvent::ShortcutOverride: {
|
||||
QKeyEvent * ke = static_cast<QKeyEvent*>(e);
|
||||
if (d.tab_widget_->count() == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user