From 3906462fcfee763ccdb0b43fb723dc7f88f05ece Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Tue, 7 Feb 2023 02:30:42 -0800 Subject: [PATCH] Fix remaining tab crash from not clearing tracking tags correctly 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 --- src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m b/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m index e782b0a03c..08f2487511 100644 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m +++ b/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m @@ -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 @@ -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]; } }