Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash in auto hide tab #552

Merged

Conversation

SyarifFakhri
Copy link

Hi @githubuser0xFFFF, hope you are doing well 😄

Here's a bug fix for a small crash that I found.

How to reproduce:

  1. In AdvancedDockingSystem::MainWindow, add CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideSideBarsIconOnly);
  2. Pin a dock that has an icon (Ensure that it's pinned to the left or right side)
  3. Try to drag it out into its own window
  4. Observe that it crashes on CAutoHideTab::mouseReleaseEvent -> d->DockWidget->autoHideDockContainer()->resetToInitialDockWidgetSize(); because autoHideDockContainer is nullptr

Fix
The crash can actually happen with non icon only tabs, but is masked by the orientation check, this is why it doesn't happen normally.
Fix: Check if auto hide container exists first on mouse finish dragging event.

- Crash is caused by dragging an autohide tab out when it is an icon only.
- The crash can actually happen with non icon only tabs, but is masked by the orientation check.
- Soln: Check if auto hide container exists first on mouse finish dragging event.
@githubuser0xFFFF
Copy link
Owner

Thank you

@githubuser0xFFFF githubuser0xFFFF merged commit 61573cb into githubuser0xFFFF:master Aug 24, 2023
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