diff --git a/Vocaluxe/Base/CSongs.cs b/Vocaluxe/Base/CSongs.cs index f66d5b75..8afaaf9f 100644 --- a/Vocaluxe/Base/CSongs.cs +++ b/Vocaluxe/Base/CSongs.cs @@ -374,7 +374,6 @@ namespace Vocaluxe.Base CLog.StopBenchmark("Load Covers/Notes"); } CLog.StopBenchmark("Load Songs "); - GC.Collect(); } public static void LoadCover() @@ -419,7 +418,6 @@ namespace Vocaluxe.Base song.LoadSmallCover(); NumSongsWithCoverLoaded++; } - GC.Collect(); _CoverLoaded = true; CDataBase.CommitCovers(); } diff --git a/Vocaluxe/Program.cs b/Vocaluxe/Program.cs index 8926c619..a90b96bd 100644 --- a/Vocaluxe/Program.cs +++ b/Vocaluxe/Program.cs @@ -230,6 +230,9 @@ namespace Vocaluxe CLog.StopBenchmark("Init Party Modes"); Application.DoEvents(); + //Only reasonable point to call GC.Collect() because initialization may cause lots of garbage + //Rely on GC doing its job afterwards and call Dispose methods where appropriate + GC.Collect(); } catch (Exception e) { diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 9b58c99a..32e0442e 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -577,7 +577,6 @@ namespace Vocaluxe.Screens _Texts[_TextSongName].Text = String.Empty; _Texts[_TextDuetName1].Text = String.Empty; _Texts[_TextDuetName2].Text = String.Empty; - GC.Collect(); } private void _LoadNextSong() @@ -639,7 +638,6 @@ namespace Vocaluxe.Screens _SlideShow = GetNewBackground(); foreach (string bgFile in song.BackgroundFileNames) _SlideShow.AddSlideShowTexture(Path.Combine(song.Folder, bgFile)); - _Background = null; } else if (song.BackgroundFileNames.Count == 1) {