Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.3
-
None
-
-
9ea9e2476 (dev), cc5e15491 (6.7), 1d70ba5ca (6.6), 79e28f455 (tqtc/lts-6.5)
Description
The QMainWindowLayout::restoreState starts a problem that causes a crash in the future.
It starts with resetting a unique_ptr called restoredState:
restoredState.reset(new QMainWindowLayoutState(layoutState));
The layoutState copies the restoredState's data in QMainWindowLayout::setGeometry but the restoredState can have invalid data (for example: dangling pointer).
You can get the demo source here:
https://github.com/GigaXenuM/RestoreState
To reproduse the crash build and run app above. Then close and run it again.
Attachments
For Gerrit Dashboard: QTBUG-120025 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
524835,2 | QMainWindow: don't crash when restored state is modified before applied | dev | qt/qtbase | Status: MERGED | +2 | 0 |
525029,2 | QMainWindow: don't crash when restored state is modified before applied | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
525239,2 | QMainWindow: don't crash when restored state is modified before applied | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
525346,2 | QMainWindow: don't crash when restored state is modified before applied | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |