Skip to content

Commit

Permalink
fixed bug: PendingAddToRegistry and SeenInRegistry are both true but …
Browse files Browse the repository at this point in the history
…because of the former, it still tries to add it (causing an exception)
  • Loading branch information
sharpjd committed May 1, 2024
1 parent 3b368d9 commit c09aa93
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions GPUPrefSwitcher/Switcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,11 @@ private static async Task RunUpdateLogic()
WriteRegistryToXML();
}

WriteXMLToRegistry(currentPowerLineStatus);

//This NEEDS to come before (XML -> Registry) and after (Registry -> XML) (XML -> Registry depends on this)
UpdateSeenInRegistryStatuses(); //sets the SeenInRegistry entry accordingly

WriteXMLToRegistry(currentPowerLineStatus);

AppEntrySaveHandler appEntrySaveHandler = await appEntryLibrarian.Borrow();
Task swaps = BeginFileSwapLogic(currentPowerLineStatus, appEntrySaveHandler.CurrentAppEntries);
appEntryLibrarian.Return(appEntrySaveHandler);
Expand Down Expand Up @@ -491,7 +492,7 @@ internal static void WriteXMLToRegistry(PowerLineStatus powerLineStatus)
foreach (AppEntry appEntry in appEntries)
{

if (appEntry.PendingAddToRegistry)
if (appEntry.PendingAddToRegistry && !appEntry.SeenInRegistry)
{

Logger.inst.Log($"Pending registry add detected: {appEntry.AppPath}");
Expand Down

0 comments on commit c09aa93

Please sign in to comment.