-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QMdiArea: update indices list before potentially operating on it
When a subwindow before the current active window is removed, the mapping of window index to index in the activated history needs to be updated. This was done too late, so intermediate calls (e.g. to update the layout of the area as a side-effect of calling updateTabBarGeometry) operated on indices that were out of bounds, leading to asserts. Fix this bug by updating the index list as the first thing in updateActiveWindow() which is always called when a window gets removed. As a drive-by, make use of the fact that C++ knows about references, instead of taking the address of the integer in the list. Add a test case that asserts without the fix, and passes with it. Fixes: QTBUG-129596 Pick-to: 6.8 6.5 Change-Id: I94d78dd49f486ee4aa6ffbddf528d985a206820d Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
- Loading branch information
Showing
2 changed files
with
50 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters