diff --git a/Modules/Disk/readers.swift b/Modules/Disk/readers.swift index cf634678..19ac440a 100644 --- a/Modules/Disk/readers.swift +++ b/Modules/Disk/readers.swift @@ -166,14 +166,22 @@ internal class CapacityReader: Reader { var result = IOCreatePlugInInterfaceForService(disk, kIONVMeSMARTUserClientTypeID, kIOCFPlugInInterfaceID, &pluginInterface, &score) guard result == kIOReturnSuccess else { return nil } - defer { IODestroyPlugInInterface(pluginInterface) } + defer { + if pluginInterface != nil { + IODestroyPlugInInterface(pluginInterface) + } + } result = withUnsafeMutablePointer(to: &smartInterface) { $0.withMemoryRebound(to: Optional.self, capacity: 1) { pluginInterface?.pointee?.pointee.QueryInterface(pluginInterface, CFUUIDGetUUIDBytes(kIONVMeSMARTInterfaceID), $0) ?? KERN_NOT_FOUND } } - defer { _ = pluginInterface?.pointee?.pointee.Release(smartInterface) } + defer { + if smartInterface != nil { + _ = pluginInterface?.pointee?.pointee.Release(smartInterface) + } + } guard result == KERN_SUCCESS, let smart = smartInterface?.pointee else { return nil } var smartData: nvme_smart_log = nvme_smart_log() diff --git a/Stats/Supporting Files/Info.plist b/Stats/Supporting Files/Info.plist index 78793249..335f8fa6 100755 --- a/Stats/Supporting Files/Info.plist +++ b/Stats/Supporting Files/Info.plist @@ -17,7 +17,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 474 + 476 Description Simple macOS system monitor in your menu bar LSApplicationCategoryType