diff options
-rw-r--r-- | xbmc/osx/DarwinUtils.h | 1 | ||||
-rw-r--r-- | xbmc/osx/DarwinUtils.mm | 14 | ||||
-rw-r--r-- | xbmc/storage/osx/DarwinStorageProvider.cpp | 8 |
3 files changed, 23 insertions, 0 deletions
diff --git a/xbmc/osx/DarwinUtils.h b/xbmc/osx/DarwinUtils.h index 77635489fe..0a0423edc1 100644 --- a/xbmc/osx/DarwinUtils.h +++ b/xbmc/osx/DarwinUtils.h @@ -33,6 +33,7 @@ public: static const char *getIosPlatformString(void); static bool IsAppleTV2(void); static bool IsMavericks(void); + static bool IsLion(void); static bool IsSnowLeopard(void); static bool DeviceHasRetina(double &scale); static const char *GetOSReleaseString(void); diff --git a/xbmc/osx/DarwinUtils.mm b/xbmc/osx/DarwinUtils.mm index 75ece9f8b5..b1b282f5d1 100644 --- a/xbmc/osx/DarwinUtils.mm +++ b/xbmc/osx/DarwinUtils.mm @@ -212,6 +212,20 @@ bool CDarwinUtils::IsMavericks(void) return isMavericks == 1; } +bool CDarwinUtils::IsLion(void) +{ + static int isLion = -1; +#if defined(TARGET_DARWIN_OSX) + if (isLion == -1) + { + double appKitVersion = floor(NSAppKitVersionNumber); + // everything lower 10.8 is 10.7.x because 10.7 is deployment target... + isLion = (appKitVersion < NSAppKitVersionNumber10_8) ? 1 : 0; + } +#endif + return isLion == 1; +} + bool CDarwinUtils::IsSnowLeopard(void) { static int isSnowLeopard = -1; diff --git a/xbmc/storage/osx/DarwinStorageProvider.cpp b/xbmc/storage/osx/DarwinStorageProvider.cpp index 6be9ab13cd..19c99b7ef2 100644 --- a/xbmc/storage/osx/DarwinStorageProvider.cpp +++ b/xbmc/storage/osx/DarwinStorageProvider.cpp @@ -29,6 +29,7 @@ #include <DiskArbitration/DiskArbitration.h> #include <IOKit/storage/IOCDMedia.h> #include <IOKit/storage/IODVDMedia.h> +#include "osx/DarwinUtils.h" #endif #include "osx/CocoaInterface.h" @@ -62,6 +63,9 @@ void CDarwinStorageProvider::GetLocalDrives(VECSOURCES &localDrives) share.strName = "Volumes"; share.m_ignore = true; localDrives.push_back(share); + + if (CDarwinUtils::IsLion()) + return; //temp workaround for crash in Cocoa_GetVolumeNameFromMountPoint on 10.7.x // This will pick up all local non-removable disks including the Root Disk. DASessionRef session = DASessionCreate(kCFAllocatorDefault); @@ -106,6 +110,10 @@ void CDarwinStorageProvider::GetLocalDrives(VECSOURCES &localDrives) void CDarwinStorageProvider::GetRemovableDrives(VECSOURCES &removableDrives) { #if defined(TARGET_DARWIN_OSX) + + if (CDarwinUtils::IsLion()) + return; //temp workaround for crash in Cocoa_GetVolumeNameFromMountPoint on 10.7.x + DASessionRef session = DASessionCreate(kCFAllocatorDefault); if (session) { |