Skip to content

Conversation

@studiofuga
Copy link

In certain conditions, not clear which, when clicking on "Close Others", not all tabs are closed as expected, but one or two tabs are left open.
As said, it's not clear the origin of this bug. But we can consistently trigger it in our application.
Likely, the issue is a race condition between the Q_EMIT on requesting the close of the tab, and the subsequent isClosed test in the code handling the command.
Fortunately, there's a easy and elegant solution, that is, instead of fixing the tab index based on the close state of the being-closed tab, we can count backward and ignore wheather the tab was closed or not. This totally avoid the async problem with the user request.
This fixes the issue on our application and still works on the demo app.

@githubuser0xFFFF
Copy link
Owner

Thank you very much for this nice fix

@githubuser0xFFFF githubuser0xFFFF merged commit df1fa27 into githubuser0xFFFF:master Mar 17, 2025
1 check passed
mike-malburg pushed a commit to TechSmith/Qt-Advanced-Docking-System that referenced this pull request Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants