Fixed crash when disconnecting external display on iOS
This commit is contained in:
parent
e559b271b5
commit
753f3f8609
2 changed files with 5 additions and 4 deletions
|
@ -48,7 +48,7 @@ extern SDL_bool UIKit_IsDisplayLandscape(UIScreen *uiscreen);
|
||||||
extern int UIKit_InitModes(SDL_VideoDevice *_this);
|
extern int UIKit_InitModes(SDL_VideoDevice *_this);
|
||||||
#ifndef SDL_PLATFORM_VISIONOS
|
#ifndef SDL_PLATFORM_VISIONOS
|
||||||
extern int UIKit_AddDisplay(UIScreen *uiscreen, SDL_bool send_event);
|
extern int UIKit_AddDisplay(UIScreen *uiscreen, SDL_bool send_event);
|
||||||
extern void UIKit_DelDisplay(UIScreen *uiscreen);
|
extern void UIKit_DelDisplay(UIScreen *uiscreen, SDL_bool send_event);
|
||||||
#endif
|
#endif
|
||||||
extern int UIKit_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display);
|
extern int UIKit_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display);
|
||||||
extern int UIKit_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
|
extern int UIKit_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
|
||||||
|
|
|
@ -92,7 +92,7 @@
|
||||||
+ (void)screenDisconnected:(NSNotification *)notification
|
+ (void)screenDisconnected:(NSNotification *)notification
|
||||||
{
|
{
|
||||||
UIScreen *uiscreen = [notification object];
|
UIScreen *uiscreen = [notification object];
|
||||||
UIKit_DelDisplay(uiscreen);
|
UIKit_DelDisplay(uiscreen, SDL_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -308,7 +308,7 @@ int UIKit_AddDisplay(SDL_bool send_event){
|
||||||
|
|
||||||
#ifndef SDL_PLATFORM_VISIONOS
|
#ifndef SDL_PLATFORM_VISIONOS
|
||||||
|
|
||||||
void UIKit_DelDisplay(UIScreen *uiscreen)
|
void UIKit_DelDisplay(UIScreen *uiscreen, SDL_bool send_event)
|
||||||
{
|
{
|
||||||
SDL_DisplayID *displays;
|
SDL_DisplayID *displays;
|
||||||
int i;
|
int i;
|
||||||
|
@ -321,7 +321,8 @@ void UIKit_DelDisplay(UIScreen *uiscreen)
|
||||||
|
|
||||||
if (data && data.uiscreen == uiscreen) {
|
if (data && data.uiscreen == uiscreen) {
|
||||||
CFRelease(display->driverdata);
|
CFRelease(display->driverdata);
|
||||||
SDL_DelVideoDisplay(displays[i], SDL_FALSE);
|
display->driverdata = NULL;
|
||||||
|
SDL_DelVideoDisplay(displays[i], send_event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue