┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Englbrecht <[email protected]>2026-05-27 20:00:21 +0200
committerMéven Car <[email protected]>2026-05-28 08:56:34 +0000
commit838688e00f638f70137102e2d1593eb9cc4a5484 (patch)
tree67e705d0857730f1095af6b50740eea2a6d3e702
parente8cbf8f3c5c56e3473566498880c9a92e54001db (diff)
barsecondrowflowlayout: avoid virtual call in destructor
cppcheck warns about calling virtual functions during destruction because dynamic dispatch is no longer reliable at that point. Replace takeAt(0) with direct access to itemList.takeFirst() to drain the list without going through the virtual interface.
-rw-r--r--src/search/barsecondrowflowlayout.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/search/barsecondrowflowlayout.cpp b/src/search/barsecondrowflowlayout.cpp
index 29e3513e8..3ef035f16 100644
--- a/src/search/barsecondrowflowlayout.cpp
+++ b/src/search/barsecondrowflowlayout.cpp
@@ -25,9 +25,8 @@ BarSecondRowFlowLayout::BarSecondRowFlowLayout(QWidget *parent)
BarSecondRowFlowLayout::~BarSecondRowFlowLayout()
{
- QLayoutItem *item;
- while ((item = takeAt(0)))
- delete item;
+ while (!itemList.isEmpty())
+ delete itemList.takeFirst();
}
void BarSecondRowFlowLayout::addItem(QLayoutItem *item)