diff --git a/Lemon/Info.plist b/Lemon/Info.plist index cf356e2ca..cafeda9f9 100644 --- a/Lemon/Info.plist +++ b/Lemon/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 5.1.9 CFBundleVersion - 1018 + 1019 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSAppTransportSecurity diff --git a/localPod/LemonStat/LemonStat/Classes/src/McGpuInfo.m b/localPod/LemonStat/LemonStat/Classes/src/McGpuInfo.m index 72e91579d..ff2730c27 100644 --- a/localPod/LemonStat/LemonStat/Classes/src/McGpuInfo.m +++ b/localPod/LemonStat/LemonStat/Classes/src/McGpuInfo.m @@ -38,20 +38,24 @@ - (void)updateInfoIOService { } NSNumber *utilization = stats[@"Device Utilization %"]; - if (!utilization) { + if (![utilization isKindOfClass:NSNumber.class]) { utilization = stats[@"GPU Activity(%)"]; } - if (!utilization) { + if (![utilization isKindOfClass:NSNumber.class]) { continue; } // IOKit 框架定义的标识符属性 - NSInteger IOVARendererID = [dict[@"IOVARendererID"] longValue]; + NSNumber *IOVARendererID = dict[@"IOVARendererID"]; + NSInteger ID = 0; + if ([IOVARendererID isKindOfClass:NSNumber.class]) { + ID = [IOVARendererID longValue]; + } CGFloat usage = [utilization longValue] / 100.0; usage = fmaxf(0.0, fminf(usage, 1.0)); McGpuCore *gpuCore = [[McGpuCore alloc] init]; - gpuCore.ID = IOVARendererID; + gpuCore.ID = ID; gpuCore.usage = usage; [mutableCores addObject:gpuCore];