Skip to content

Commit cd4bd98

Browse files
committed
Fix opening a tab crashing MacVim
This seems to be a really old bug but new interactions with macOS (probably due to macOS 13 Ventura) caused it to surface and crash. Previously it was assuming a call to removeTrackingRect must always come only after addTrackingRect was called, which was not a good assumption to make. As a result, we could call this and end up triggering other code in macOS when passing in a 0 tracking tag. Fix #1333
1 parent d311aae commit cd4bd98

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/MacVim/PSMTabBarControl/source/PSMRolloverButton.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ - (void)addTrackingRect
5252

5353
- (void)removeTrackingRect
5454
{
55-
[self removeTrackingRect:_myTrackingRectTag];
55+
if (_myTrackingRectTag != 0)
56+
[self removeTrackingRect:_myTrackingRectTag];
57+
_myTrackingRectTag = 0;
5658
}
5759

5860
// override for rollover effect

0 commit comments

Comments
 (0)