Fixed crash when trying to disconnect secondary display on iOS

(cherry picked from commit 934d6954e2)
This commit is contained in:
Deve authored and Sam Lantinga committed 2025-01-29 14:46:48 -08:00
1 parent 97002d81a7
commit 1650c0289d
2 files changed
+3

No files matched your search

+2
View File
@@ -688,7 +688,9 @@ void SDL_DelVideoDisplay(int index)
SDL_SendDisplayEvent(&_this->displays[index], SDL_DISPLAYEVENT_DISCONNECTED, 0);
SDL_free(_this->displays[index].driverdata);
_this->displays[index].driverdata = NULL;
SDL_free(_this->displays[index].name);
_this->displays[index].name = NULL;
if (index < (_this->num_displays - 1)) {
SDL_memmove(&_this->displays[index], &_this->displays[index + 1], (_this->num_displays - index - 1) * sizeof(_this->displays[index]));
}
+1
View File
@@ -344,6 +344,7 @@ void UIKit_DelDisplay(UIScreen *uiscreen)
if (data && data.uiscreen == uiscreen) {
CFRelease(SDL_GetDisplayDriverData(i));
SDL_GetDisplay(i)->driverdata = NULL;
SDL_DelVideoDisplay(i);
return;
}