X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiApplication.cpp;h=35b639c9ac490e27e09ee25c123afce961eb9840;hb=c0a1893008bd13650d470afff16f56720b65c87c;hp=b21d86ed27a4fb794ea0ba6d42be76a26e7e130e;hpb=6dc1884d05ee0d51dd896c7b924fdec758ea3d8e;p=lyx.git diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index b21d86ed27..35b639c9ac 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -1407,7 +1407,7 @@ DispatchResult const & GuiApplication::dispatch(FuncRequest const & cmd) updateCurrentView(cmd, dr); // the buffer may have been closed by one action - if (theBufferList().isLoaded(buffer)) + if (theBufferList().isLoaded(buffer) || theBufferList().isInternal(buffer)) buffer->undo().endUndoGroup(); d->dispatch_result_ = dr; @@ -1883,7 +1883,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr) dispatch(func); } // the buffer may have been closed by one action - if (theBufferList().isLoaded(buffer)) + if (theBufferList().isLoaded(buffer) || theBufferList().isInternal(buffer)) buffer->undo().endUndoGroup(); break; } @@ -2289,8 +2289,12 @@ void GuiApplication::processFuncRequestAsync(FuncRequest const & func) void GuiApplication::processFuncRequestQueue() { while (!d->func_request_queue_.empty()) { - processFuncRequest(d->func_request_queue_.front()); + // take the item from the stack _before_ processing the + // request in order to avoid race conditions from nested + // or parallel requests (see #10406) + FuncRequest const fr(d->func_request_queue_.front()); d->func_request_queue_.pop(); + processFuncRequest(fr); } } @@ -2723,7 +2727,8 @@ bool GuiApplication::notify(QObject * receiver, QEvent * event) #endif // In release mode, try to exit gracefully. this->exit(1); - + // FIXME: GCC 7 thinks we can fall through here. Can we? + // fall through case BufferException: { if (!current_view_ || !current_view_->documentBufferView()) return false;