Fix a potential crash in macOS 10.7 and earlier.

Alex Szpakowski 2017-07-12 21:32:10 -03:00
parent 8292d73ebb
commit e0ea4da4ae
1 changed files with 4 additions and 1 deletions

View File

@ -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;