Skip to content

Commit a0f93a6

Browse files
committed
Merge remote-tracking branch 'lib/master'
2 parents 38e1b4c + 16ad77a commit a0f93a6

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

OpenHardwareMonitor/UI/MainForm.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,15 +870,15 @@ private void SysTrayHideShow()
870870

871871
protected override void WndProc(ref Message m)
872872
{
873-
if (_minimizeToTray.Value && m.Msg == WinApiConstants.WM_SYS_COMMAND && m.WParam.ToInt64() == WinApiConstants.SC_MINIMIZE)
873+
if (_minimizeToTray.Value && m.Msg == WinApiHelper.WM_SYS_COMMAND && m.WParam.ToInt64() == WinApiHelper.SC_MINIMIZE)
874874
{
875875
SysTrayHideShow();
876876
}
877877
//else if (m.Msg == WinApiHelper.WM_WININICHANGE && Marshal.PtrToStringUni(m.LParam) == "ImmersiveColorSet" && Theme.IsAutoThemeEnabled)
878878
//{
879879
// Theme.SetAutoTheme();
880880
//}
881-
else if (_minimizeOnClose.Value && m.Msg == WinApiConstants.WM_SYS_COMMAND && m.WParam.ToInt64() == WinApiConstants.SC_CLOSE)
881+
else if (_minimizeOnClose.Value && m.Msg == WinApiHelper.WM_SYS_COMMAND && m.WParam.ToInt64() == WinApiHelper.SC_CLOSE)
882882
{
883883
//Apparently the user wants to minimize rather than close
884884
//Now we still need to check if we're going to the tray or not

OpenHardwareMonitorLib/Hardware/Memory/MemoryGroup.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ private static bool DetectThermalSensors(out List<SPDAccessor> accessors)
161161

162162
private void AddDimms(List<SPDAccessor> accessors, ISettings settings)
163163
{
164+
List<Hardware> additions = [];
165+
164166
foreach (SPDAccessor ram in accessors)
165167
{
166168
//Default value
@@ -171,9 +173,11 @@ private void AddDimms(List<SPDAccessor> accessors, ISettings settings)
171173
name = $"{ram.GetModuleManufacturerString()} - {ram.ModulePartNumber()} (#{ram.Index})";
172174

173175
DimmMemory memory = new(ram, name, new Identifier($"memory/dimm/{ram.Index}"), settings);
174-
175-
_hardware.Add(memory);
176-
HardwareAdded?.Invoke(memory);
176+
additions.Add(memory);
177177
}
178+
179+
_hardware = [.. _hardware, .. additions];
180+
foreach (Hardware hardware in additions)
181+
HardwareAdded?.Invoke(hardware);
178182
}
179183
}

0 commit comments

Comments
 (0)