Skip to content

Commit

Permalink
imp - Call EndSplashOut() in Rebooting!
Browse files Browse the repository at this point in the history
---

We're accidentally calling BeginSplashOut() twice instead of EndSplashOut!

---

Type: imp
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Feb 9, 2024
1 parent 546a93a commit 40248b4
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions public/Nitrocid/Kernel/Starting/KernelInitializers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ internal static void InitializeOptional()

internal static void ResetEverything()
{
var context = !PowerManager.KernelShutdown ? SplashContext.Rebooting : SplashContext.ShuttingDown;
try
{
// Reset every variable below
Expand Down Expand Up @@ -373,29 +374,20 @@ internal static void ResetEverything()
{
// We could fail with the debugger enabled
ColorTools.LoadBack();
if (!PowerManager.KernelShutdown)
SplashManager.BeginSplashOut(SplashContext.Rebooting);
else
SplashManager.BeginSplashOut(SplashContext.ShuttingDown);
SplashManager.BeginSplashOut(context);
DebugWriter.WriteDebug(DebugLevel.E, $"Failed to reset everything! {ex.Message}");
DebugWriter.WriteDebugStackTrace(ex);
InfoBoxColor.WriteInfoBox(
Translate.DoTranslation("The kernel failed to reset all the configuration to their initial states. Some of the components might have not unloaded correctly. If you're experiencing problems after the reboot, this might be the cause. Please shut down the kernel once rebooted.") + "\n\n" +
Translate.DoTranslation("Error information:") + $" {ex.Message}"
);
if (!PowerManager.KernelShutdown)
SplashManager.BeginSplashOut(SplashContext.Rebooting);
else
SplashManager.EndSplashOut(SplashContext.ShuttingDown);
SplashManager.EndSplashOut(context);
}
finally
{
// Unload all custom splashes
SplashReport.ReportProgress(Translate.DoTranslation("Goodbye!"));
if (!PowerManager.KernelShutdown)
SplashManager.CloseSplash(SplashContext.Rebooting);
else
SplashManager.CloseSplash(SplashContext.ShuttingDown);
SplashManager.CloseSplash(context);
SplashManager.customSplashes.Clear();

// Clear remaining lists
Expand Down

0 comments on commit 40248b4

Please sign in to comment.