Fix a potential crash in macOS 10.7 and earlier.

This commit is contained in:
Alex Szpakowski 2017-07-12 21:32:10 -03:00
parent 3b53c08eec
commit 4cff21b525

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;