Skip to content

Commit

Permalink
Fix remaining tab crash from not clearing tracking tags correctly
Browse files Browse the repository at this point in the history
Similar to #1334. The old PSMTabBarControl code has a lot of dubious
straggling states regarding the tracking tags. Seems like previous macOS
versions tolerated that but in the newer macOS versions, the tags seem
to be reused for other purposes and so when you double-remove the tags,
you get into trouble.

Related to #1333
  • Loading branch information
ychin committed Feb 7, 2023
1 parent b2dacc5 commit 3906462
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m
Expand Up @@ -476,9 +476,11 @@ - (void)removeTabForCell:(PSMTabBarCell *)cell
[[NSNotificationCenter defaultCenter] removeObserver:cell];
if([cell closeButtonTrackingTag] != 0){
[self removeTrackingRect:[cell closeButtonTrackingTag]];
[cell setCloseButtonTrackingTag:0];
}
if([cell cellTrackingTag] != 0){
[self removeTrackingRect:[cell cellTrackingTag]];
[cell setCellTrackingTag:0];
}

// pull from collection
Expand Down Expand Up @@ -665,9 +667,11 @@ - (void)update
[[NSNotificationCenter defaultCenter] removeObserver:cell];
if([cell closeButtonTrackingTag] != 0){
[self removeTrackingRect:[cell closeButtonTrackingTag]];
[cell setCloseButtonTrackingTag:0];
}
if([cell cellTrackingTag] != 0){
[self removeTrackingRect:[cell cellTrackingTag]];
[cell setCellTrackingTag:0];
}
}

Expand Down

0 comments on commit 3906462

Please sign in to comment.