Explorar el Código

Fix a potential crash in macOS 10.7 and earlier.

Alex Szpakowski hace 8 años
padre
commit
e0ea4da4ae
Se han modificado 1 ficheros con 4 adiciones y 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;