CPU Usage Dive by Zero Issue (Chrome Console Error Reported)
Added explicit checks in “CpuUse::UpdateCpuUse” to avoid division by zero; CPU usage and overhead are forced to 0 when times are zero Validated audio driver CPU usage in “AudioHost::getJackStatus”, replacing non‑finite results with 0
This commit is contained in:
+5
-1
@@ -2119,7 +2119,11 @@ public:
|
||||
|
||||
if (this->audioDriver != nullptr)
|
||||
{
|
||||
result.cpuUsage_ = audioDriver->CpuUse();
|
||||
result.cpuUsage_ = audioDriver->CpuUse();
|
||||
if (!std::isfinite(result.cpuUsage_))
|
||||
{
|
||||
result.cpuUsage_ = 0.0f;
|
||||
}
|
||||
}
|
||||
GetCpuFrequency(&result.cpuFreqMin_, &result.cpuFreqMax_);
|
||||
result.hasCpuGovernor_ = HasCpuGovernor();
|
||||
|
||||
Reference in New Issue
Block a user