Fix NIC refresh logic when disabled (#58)

This commit is contained in:
Nick Babcock
2018-10-30 14:45:53 +01:00
committed by Phyxion
parent 5d89cdc43d
commit 2a760ad98f
+9 -6
View File
@@ -401,15 +401,18 @@ namespace OpenHardwareMonitor.Hardware {
}
public void Traverse(IVisitor visitor) {
if (nicEnabled) {
int newNiccount = NetworkInterface.GetAllNetworkInterfaces().Length;
if (nicCount != newNiccount) {
nicCount = newNiccount;
NICEnabled = false;
NICEnabled = true;
}
}
foreach (IGroup group in groups)
foreach (IHardware hardware in group.Hardware)
hardware.Accept(visitor);
int newNiccount = NetworkInterface.GetAllNetworkInterfaces().Length;
if (nicCount != newNiccount) {
nicCount = newNiccount;
NICEnabled = false;
NICEnabled = true;
}
}
private class Settings : ISettings {