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

Fixed issue where if you turned on auto hiding, then you closed the 2nd to last tab, the tab bar would hide, BUT it wouldn't release the NSTabViewItem you just closed. #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chrismcs
Copy link
Contributor

If you have auto-hiding turned on for your tab bar and then you close the 2nd to the last tab, the update: method would hide the tab bar, then short-circuit and return. This means it never actually removed the tab bar item (if you are watching allocations in Instruments, you’d see that there are still 2 NSTabViewItems that are alive). Also, because update: was short-circuited, the delegate never got “didDetachTabViewItem” called for that tab you just closed.

This may or may not be the best way to fix it - I’m not familiar enough with the project to know if there’s a more appropriate place to put this fix - but from my testing, it resolves the memory issue + the delegate call issue.

…nd to last tab, the tab bar would hide, BUT it wouldn't release the NSTabViewItem you just closed.
@TAKeanice
Copy link

We encountered the same issue in Vienna (https://github.com/ViennaRSS/vienna-rss), so I made a one-line fix in a49ddf6 for it. It is much simpler, but does the trick. It could be cherry-picked as an alternative to this PR.
Of course, for consistency reasons, the demo app should log the delegate call just as all the others, which is implemented in @chrismcs commit (55ef0a6) and thus included in the PR

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