Skip to content

Commit

Permalink
Merge pull request #7902 from sloriot/CGALLab-fix_menu_filtering
Browse files Browse the repository at this point in the history
Copy the buffer to allow modifications during iteration
  • Loading branch information
lrineau committed Dec 1, 2023
2 parents 120547b + a8c58f8 commit 29c90e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Polyhedron/demo/Polyhedron/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ void filterMenuOperations(QMenu* menu, QString filter, bool keep_from_here)
buffer.append(action);

while(!buffer.isEmpty()){
for(QAction* action : buffer) {
QList<QAction*> buffer_copy=buffer; // make a copy as we modify buffer in the loop
for(QAction* action : buffer_copy) {
if(QMenu* submenu = action->menu())
{
bool keep = true;
Expand Down

0 comments on commit 29c90e5

Please sign in to comment.