mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: fixed memory leak in the Battery reader
This commit is contained in:
@@ -91,7 +91,7 @@ internal class UsageReader: Reader<Battery_Usage> {
|
||||
|
||||
var ACwatts: Int = 0
|
||||
if let ACDetails = IOPSCopyExternalPowerAdapterDetails() {
|
||||
if let ACList = ACDetails.takeUnretainedValue() as? Dictionary<String, Any> {
|
||||
if let ACList = ACDetails.takeRetainedValue() as? Dictionary<String, Any> {
|
||||
guard let watts = ACList[kIOPSPowerAdapterWattsKey] else {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user