diff options
| author | Sebastian Englbrecht <[email protected]> | 2026-05-27 20:00:21 +0200 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2026-05-28 08:56:34 +0000 |
| commit | 838688e00f638f70137102e2d1593eb9cc4a5484 (patch) | |
| tree | 67e705d0857730f1095af6b50740eea2a6d3e702 /src/search/barsecondrowflowlayout.cpp | |
| parent | e8cbf8f3c5c56e3473566498880c9a92e54001db (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.
Diffstat (limited to 'src/search/barsecondrowflowlayout.cpp')
| -rw-r--r-- | src/search/barsecondrowflowlayout.cpp | 5 |
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) |
