Explorar o código

Fix a potential crash in macOS 10.7 and earlier.

Alex Szpakowski %!s(int64=8) %!d(string=hai) anos
pai
achega
e0ea4da4ae
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/video/cocoa/SDL_cocoamodes.m

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

@@ -392,7 +392,10 @@ Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
 #endif
 
     modes = CGDisplayCopyAllDisplayModes(data->display, dict);
-    CFRelease(dict);
+
+    if (dict != NULL) {
+        CFRelease(dict);
+    }
 
     if (modes) {
         CVDisplayLinkRef link = NULL;