aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjenkins4kodi <jenkins4kodi@users.noreply.github.com>2015-06-10 10:36:23 +0200
committerjenkins4kodi <jenkins4kodi@users.noreply.github.com>2015-06-10 10:36:23 +0200
commit658e700747d370381eb050d1071ef06529cb0859 (patch)
tree6b80f1bfad3ff25888f557d341a88befda285245
parent00f31707983cc4999daa75bc2a7236ada82fe592 (diff)
parent1435210f43a8ab5dc4c39a3a6041a1e774862e28 (diff)
Merge pull request #7252 from Memphiz/osx_fix_badaccess
-rw-r--r--xbmc/windowing/osx/WinSystemOSX.mm27
1 files changed, 23 insertions, 4 deletions
diff --git a/xbmc/windowing/osx/WinSystemOSX.mm b/xbmc/windowing/osx/WinSystemOSX.mm
index 292c129eca..42fdfb6ef8 100644
--- a/xbmc/windowing/osx/WinSystemOSX.mm
+++ b/xbmc/windowing/osx/WinSystemOSX.mm
@@ -1079,7 +1079,12 @@ void CWinSystemOSX::UpdateResolutions()
GetScreenResolution(&w, &h, &fps, 0);
UpdateDesktopResolution(CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP), 0, w, h, fps);
NSString *dispName = screenNameForDisplay(GetDisplayID(0));
- CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP).strOutput = [dispName UTF8String];
+
+ if (dispName != nil)
+ {
+ CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP).strOutput = [dispName UTF8String];
+ }
+
CDisplaySettings::Get().ClearCustomResolutions();
// see resolution.h enum RESOLUTION for how the resolutions
@@ -1092,7 +1097,12 @@ void CWinSystemOSX::UpdateResolutions()
GetScreenResolution(&w, &h, &fps, i);
UpdateDesktopResolution(res, i, w, h, fps);
dispName = screenNameForDisplay(GetDisplayID(i));
- res.strOutput = [dispName UTF8String];
+
+ if (dispName != nil)
+ {
+ res.strOutput = [dispName UTF8String];
+ }
+
CDisplaySettings::Get().AddResolutionInfo(res);
}
@@ -1303,7 +1313,11 @@ void CWinSystemOSX::FillInVideoModes()
CFArrayRef displayModes = CGDisplayAvailableModes(GetDisplayID(disp));
NSString *dispName = screenNameForDisplay(GetDisplayID(disp));
- CLog::Log(LOGNOTICE, "Display %i has name %s", disp, [dispName UTF8String]);
+
+ if (dispName != nil)
+ {
+ CLog::Log(LOGNOTICE, "Display %i has name %s", disp, [dispName UTF8String]);
+ }
if (NULL == displayModes)
continue;
@@ -1346,7 +1360,12 @@ void CWinSystemOSX::FillInVideoModes()
// this is what linux does - though it feels that there shouldn't be
// the same resolution twice... - thats why i add a FIXME here.
res.strMode = StringUtils::Format("%dx%d @ %.2f", w, h, refreshrate);
- res.strOutput = [dispName UTF8String];
+
+ if (dispName != nil)
+ {
+ res.strOutput = [dispName UTF8String];
+ }
+
g_graphicsContext.ResetOverscan(res);
CDisplaySettings::Get().AddResolutionInfo(res);
}