macOS: don't keep variable matchDict

This commit is contained in:
李通洲
2023-10-07 15:51:05 +08:00
parent 3077f885d8
commit 90ea096ca3
7 changed files with 7 additions and 29 deletions
+1 -5
View File
@@ -29,12 +29,8 @@ static const char* detectFrequency(FFCPUResult* cpu)
{
// https://github.com/giampaolo/psutil/pull/2222/files
CFMutableDictionaryRef matchDict = IOServiceMatching("AppleARMIODevice");
if (matchDict == NULL)
return "IOServiceMatching(\"AppleARMIODevice\") failed";
io_iterator_t iterator;
if(IOServiceGetMatchingServices(MACH_PORT_NULL, matchDict, &iterator) != kIOReturnSuccess)
if(IOServiceGetMatchingServices(MACH_PORT_NULL, IOServiceMatching("AppleARMIODevice"), &iterator) != kIOReturnSuccess)
return "IOServiceGetMatchingServices() failed";
io_registry_entry_t registryEntry;