mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Fix race condition in processFuncRequestQueue
The issue here was that the element was only removed from the queue
after the func request was processed, but within that process, other
function could access the queue, so the queue could even be empty
when this function finally wanted to remove the item.
Fixes: #10406.
(cherry picked from commit dadec50a18
)
This commit is contained in:
parent
e43bf58223
commit
fe414fcdd8
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user