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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.