Attempt to fix an exception:

Version: 0.1.34.0

System.NullReferenceException: Riferimento a un oggetto non impostato su un'istanza di oggetto.
   in OpenHardwareMonitor.Hardware.CPU.IntelCPU..ctor(Int32 processorIndex, CPUID[][] cpuid)
   in OpenHardwareMonitor.Hardware.CPU.CPUGroup..ctor()
   in OpenHardwareMonitor.Hardware.Computer.Open()
   in OpenHardwareMonitor.GUI.MainForm..ctor()
   in OpenHardwareMonitor.Program.Main()
This commit is contained in:
Michael Möller
2010-05-22 12:12:50 +00:00
parent 059cf44ab7
commit 1b36c9c181
+10 -16
View File
@@ -51,16 +51,13 @@ namespace OpenHardwareMonitor.Hardware.CPU {
private int thread;
private uint maxCpuid = 0;
private uint maxCpuidExt = 0;
private Vendor vendor = Vendor.Unknown;
private Vendor vendor;
private string cpuBrandString = "";
private string name = "";
private string cpuBrandString;
private string name;
private uint[,] cpuidData;
private uint[,] cpuidExtData;
private uint[,] cpuidData = new uint[0, 0];
private uint[,] cpuidExtData = new uint[0, 0];
private uint family;
private uint model;
@@ -102,6 +99,9 @@ namespace OpenHardwareMonitor.Hardware.CPU {
public CPUID(int thread) {
this.thread = thread;
uint maxCpuid = 0;
uint maxCpuidExt = 0;
uint eax, ebx, ecx, edx;
if (thread >= 32)
@@ -138,6 +138,8 @@ namespace OpenHardwareMonitor.Hardware.CPU {
maxCpuidExt = eax - CPUID_EXT;
else
return;
} else {
throw new ArgumentException();
}
} else {
throw new ArgumentException();
@@ -236,14 +238,6 @@ namespace OpenHardwareMonitor.Hardware.CPU {
get { return thread; }
}
public uint MaxCPUID {
get { return maxCpuid; }
}
public uint MaxCpuidExt {
get { return maxCpuidExt; }
}
public Vendor Vendor {
get { return vendor; }
}