Details
-
Epic
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15, 6.5, 6.8, 6.9
-
None
-
Refactor QMainWindowLayout::unusedTabBars
-
23357e59b (dev), ab6f1ad77 (6.9), 95c988325 (6.8), b37f84ba4 (dev), 0f7864fd1 (tqtc/lts-6.5), 541d53f28 (6.9), 4ca3bcd1d (6.8), 6f683248e (tqtc/lts-6.5)
Description
QMainWindowLayout::unusedTabBars contains unparented {{QMainWindowTabBar}}s.
Such tab bars were leaked, because ~QMainWindowLayout didn't get rid of them.
As they are widgets, QApplication attempted to delete them upon shut down.
At this moment, QMainWindow is already demoted to a QWidget and the attempt of ~QMainWindowTabBar to remove itself from QMainWindowLayout::unusedTabBars caused an illegal downcast.
That can be fixed in ~QMainWindowLayout by not leaking them in the first place.
However, there is no reason to keep unused, unparented tab bars around. It should therefore be considered to remove the member and create new tab bars when needed.
Found by mmutz. Thanks!
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-135468 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
636759,3 | QMainWindowLayout: Fix leaking of unused tab bars | dev | qt/qtbase | Status: MERGED | +2 | 0 |
637175,3 | QMainWindowLayout: Fix build with -no-feature-dockwidget | dev | qt/qtbase | Status: MERGED | +2 | 0 |
637199,2 | QMainWindowLayout: Fix leaking of unused tab bars | 6.9 | qt/qtbase | Status: MERGED | +2 | 0 |
637348,2 | QMainWindowLayout: Fix leaking of unused tab bars | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |
637394,2 | QMainWindowLayout: Fix leaking of unused tab bars | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
637652,2 | QMainWindowLayout: Fix build with -no-feature-dockwidget | 6.9 | qt/qtbase | Status: MERGED | +2 | 0 |
638098,2 | QMainWindowLayout: Fix build with -no-feature-dockwidget | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |
638574,2 | QMainWindowLayout: Fix build with -no-feature-dockwidget | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |