فهرست منبع

Fixed crash if app delegate method is called when SDL isn't initialized

Sam Lantinga 2 سال پیش
والد
کامیت
d211da75ac
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      src/video/cocoa/SDL_cocoaevents.m

+ 4 - 1
src/video/cocoa/SDL_cocoaevents.m

@@ -284,7 +284,10 @@ static void Cocoa_DispatchEvent(NSEvent *theEvent)
 
 - (void)screenParametersChanged:(NSNotification *)aNotification
 {
-    Cocoa_UpdateDisplays(SDL_GetVideoDevice());
+    SDL_VideoDevice *device = SDL_GetVideoDevice();
+    if (device) {
+        Cocoa_UpdateDisplays(device);
+    }
 }
 
 - (void)localeDidChange:(NSNotification *)notification