From be898fab7137f3b5e0318a37673dcab4e50436ef Mon Sep 17 00:00:00 2001 From: cerealpxl Date: Fri, 9 Feb 2024 13:11:43 -0300 Subject: [PATCH 1/2] Shutdown modules in reverse order. --- Framework/App.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Framework/App.cs b/Framework/App.cs index 23418f1..8de402b 100644 --- a/Framework/App.cs +++ b/Framework/App.cs @@ -435,7 +435,7 @@ static void Update(TimeSpan delta) Update(deltaTime); } - for (int i = 0; i < modules.Count; i ++) + for (int i = modules.Count - 1; i >= 0; i --) modules[i].Render(); Platform.FosterEndFrame(); From 0310ad10d5c56bbbe7541090dcb39358efb7c16f Mon Sep 17 00:00:00 2001 From: CerealPXL <83312057+cerealpxl@users.noreply.github.com> Date: Fri, 9 Feb 2024 13:30:43 -0300 Subject: [PATCH 2/2] Now is correctly reversing the shutdown modules --- Framework/App.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Framework/App.cs b/Framework/App.cs index 8de402b..1e3b2e6 100644 --- a/Framework/App.cs +++ b/Framework/App.cs @@ -364,7 +364,7 @@ public static void Run(string applicationName, int width, int height, bool fulls Tick(); // shutdown - for (int i = 0; i < modules.Count; i ++) + for (int i = modules.Count - 1; i >= 0; i --) modules[i].Shutdown(); modules.Clear(); @@ -435,7 +435,7 @@ static void Update(TimeSpan delta) Update(deltaTime); } - for (int i = modules.Count - 1; i >= 0; i --) + for (int i = 0; i < modules.Count; i ++) modules[i].Render(); Platform.FosterEndFrame();