This commit is contained in:
pypy
2021-01-21 11:34:01 +09:00
parent 4e2f214119
commit 4caec1b732
2 changed files with 19 additions and 10 deletions
+14 -8
View File
@@ -62,21 +62,27 @@ namespace VRCX
internal void Exit()
{
_timer.Change(-1, -1);
_performanceCounter?.Dispose();
lock (this)
{
_timer.Change(-1, -1);
_performanceCounter?.Dispose();
}
}
private void TimerCallback(object state)
{
try
lock (this)
{
if (_performanceCounter != null)
try
{
if (_performanceCounter != null)
{
CpuUsage = _performanceCounter.NextValue();
}
}
catch
{
CpuUsage = _performanceCounter.NextValue();
}
}
catch
{
}
}
}