From c61ccfd4fe76cc63591c11a9571fff78db45d9b0 Mon Sep 17 00:00:00 2001 From: Sargates Date: Tue, 15 Aug 2023 07:16:22 -0500 Subject: [PATCH] Fixed segmentation fault output on Linux build --- src/Application/Core/Controller.cs | 6 +++--- src/Application/Core/Model.cs | 4 ---- src/Application/UI/BoardUI/BoardUI.cs | 6 +++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Application/Core/Controller.cs b/src/Application/Core/Controller.cs index 663e1ec..e2f64e0 100644 --- a/src/Application/Core/Controller.cs +++ b/src/Application/Core/Controller.cs @@ -76,14 +76,14 @@ public void MainLoop() { Raylib.EndDrawing(); } - Raylib.CloseWindow(); model.ExitPlayerThreads(); model.JoinPlayerThreads(); - Raylib.CloseAudioDevice(); SaveApplicationSettings(); - view.Release(); UIHelper.Release(); + Raylib.CloseAudioDevice(); + + Raylib.CloseWindow(); } public void SaveApplicationSettings() { diff --git a/src/Application/Core/Model.cs b/src/Application/Core/Model.cs index c95c2f0..90505b8 100644 --- a/src/Application/Core/Model.cs +++ b/src/Application/Core/Model.cs @@ -204,9 +204,5 @@ public void DoubleNextState() { public void Update() { } - - - - } } \ No newline at end of file diff --git a/src/Application/UI/BoardUI/BoardUI.cs b/src/Application/UI/BoardUI/BoardUI.cs index d13b63e..e55271b 100644 --- a/src/Application/UI/BoardUI/BoardUI.cs +++ b/src/Application/UI/BoardUI/BoardUI.cs @@ -175,10 +175,10 @@ static Rectangle GetPieceTextureRect(int pieceType, bool isWhite) { //* Copied f } public void Release() { + foreach (Sound sound in BoardUI.sounds) { + Raylib.UnloadSound(sound); + } Raylib.UnloadTexture(piecesTexture); } - } - - } \ No newline at end of file