Skip to content

Commit

Permalink
Fixed crash when restoring the desktop mode on macOS
Browse files Browse the repository at this point in the history
Fixes #12460
  • Loading branch information
slouken committed Mar 4, 2025
1 parent 5f07347 commit 80ae3a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/video/cocoa/SDL_cocoamodes.m
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,9 @@ static CGError SetDisplayModeForDisplay(CGDirectDisplayID display, SDL_DisplayMo
result = CGDisplaySetDisplayMode(display, moderef, NULL);
if (result == kCGErrorSuccess) {
// If this mode works, try it first next time.
CFArrayExchangeValuesAtIndices(data->modes, i, 0);
if (i > 0) {
CFArrayExchangeValuesAtIndices(data->modes, i, 0);
}
break;
}
}
Expand Down

0 comments on commit 80ae3a7

Please sign in to comment.