mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-30 21:37:43 +08:00
Fixed crash when restoring the desktop mode on macOS
Fixes https://github.com/libsdl-org/SDL/issues/12460
This commit is contained in:
@@ -644,7 +644,9 @@ static CGError SetDisplayModeForDisplay(CGDirectDisplayID display, SDL_DisplayMo
|
|||||||
result = CGDisplaySetDisplayMode(display, moderef, NULL);
|
result = CGDisplaySetDisplayMode(display, moderef, NULL);
|
||||||
if (result == kCGErrorSuccess) {
|
if (result == kCGErrorSuccess) {
|
||||||
// If this mode works, try it first next time.
|
// If this mode works, try it first next time.
|
||||||
|
if (i > 0) {
|
||||||
CFArrayExchangeValuesAtIndices(data->modes, i, 0);
|
CFArrayExchangeValuesAtIndices(data->modes, i, 0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user