mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
lock
This commit is contained in:
@@ -62,21 +62,27 @@ namespace VRCX
|
|||||||
|
|
||||||
internal void Exit()
|
internal void Exit()
|
||||||
{
|
{
|
||||||
_timer.Change(-1, -1);
|
lock (this)
|
||||||
_performanceCounter?.Dispose();
|
{
|
||||||
|
_timer.Change(-1, -1);
|
||||||
|
_performanceCounter?.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TimerCallback(object state)
|
private void TimerCallback(object state)
|
||||||
{
|
{
|
||||||
try
|
lock (this)
|
||||||
{
|
{
|
||||||
if (_performanceCounter != null)
|
try
|
||||||
|
{
|
||||||
|
if (_performanceCounter != null)
|
||||||
|
{
|
||||||
|
CpuUsage = _performanceCounter.NextValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
{
|
{
|
||||||
CpuUsage = _performanceCounter.NextValue();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,8 +37,11 @@ namespace VRCX
|
|||||||
|
|
||||||
internal void Exit()
|
internal void Exit()
|
||||||
{
|
{
|
||||||
m_Timer.Change(-1, -1);
|
lock (this)
|
||||||
m_Client?.Dispose();
|
{
|
||||||
|
m_Timer.Change(-1, -1);
|
||||||
|
m_Client?.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TimerCallback(object state)
|
private void TimerCallback(object state)
|
||||||
|
|||||||
Reference in New Issue
Block a user