diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 67643d5d8f..fbd0f5405c 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -2271,8 +2271,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); } }