mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: trying to fix app crash when stopping battery top processes reader (#781)
This commit is contained in:
@@ -175,6 +175,10 @@ public class ProcessReader: Reader<[TopProcess]> {
|
||||
if line.matches("^\\d* +.+ \\d*.?\\d*$") {
|
||||
var str = line.trimmingCharacters(in: .whitespaces)
|
||||
|
||||
if self.paused {
|
||||
return
|
||||
}
|
||||
|
||||
let pidString = str.findAndCrop(pattern: "^\\d+")
|
||||
let usageString = str.findAndCrop(pattern: " +[0-9]+.*[0-9]*$")
|
||||
let command = str.trimmingCharacters(in: .whitespaces)
|
||||
|
||||
Reference in New Issue
Block a user