diff --git a/TwitchDownloaderWPF/PageChatRender.xaml.cs b/TwitchDownloaderWPF/PageChatRender.xaml.cs index 8c9499d1..3beb9adb 100644 --- a/TwitchDownloaderWPF/PageChatRender.xaml.cs +++ b/TwitchDownloaderWPF/PageChatRender.xaml.cs @@ -684,7 +684,7 @@ private async void SplitBtnRender_Click(object sender, RoutedEventArgs e) UpdateActionButtons(false); currentRender.Dispose(); - GC.Collect(2, GCCollectionMode.Default, false); + GC.Collect(); } } diff --git a/TwitchDownloaderWPF/TwitchTasks/ChatDownloadTask.cs b/TwitchDownloaderWPF/TwitchTasks/ChatDownloadTask.cs index dae9b74b..715da1e2 100644 --- a/TwitchDownloaderWPF/TwitchTasks/ChatDownloadTask.cs +++ b/TwitchDownloaderWPF/TwitchTasks/ChatDownloadTask.cs @@ -159,8 +159,7 @@ public async Task RunAsync() CanReinitialize = true; } TokenSource.Dispose(); - GC.Collect(); - GC.WaitForPendingFinalizers(); + GC.Collect(-1, GCCollectionMode.Default, false); } private void OnPropertyChanged([CallerMemberName] string propertyName = null) diff --git a/TwitchDownloaderWPF/TwitchTasks/ChatRenderTask.cs b/TwitchDownloaderWPF/TwitchTasks/ChatRenderTask.cs index f6f1889d..62da17cd 100644 --- a/TwitchDownloaderWPF/TwitchTasks/ChatRenderTask.cs +++ b/TwitchDownloaderWPF/TwitchTasks/ChatRenderTask.cs @@ -181,7 +181,7 @@ public async Task RunAsync() } renderer.Dispose(); TokenSource.Dispose(); - GC.Collect(2, GCCollectionMode.Default, false); + GC.Collect(-1, GCCollectionMode.Default, false); } private void OnPropertyChanged([CallerMemberName] string propertyName = null) diff --git a/TwitchDownloaderWPF/TwitchTasks/ChatUpdateTask.cs b/TwitchDownloaderWPF/TwitchTasks/ChatUpdateTask.cs index 17faa17e..2dc78a74 100644 --- a/TwitchDownloaderWPF/TwitchTasks/ChatUpdateTask.cs +++ b/TwitchDownloaderWPF/TwitchTasks/ChatUpdateTask.cs @@ -160,8 +160,7 @@ public async Task RunAsync() CanReinitialize = true; } TokenSource.Dispose(); - GC.Collect(); - GC.WaitForPendingFinalizers(); + GC.Collect(-1, GCCollectionMode.Default, false); } private void OnPropertyChanged([CallerMemberName] string propertyName = null) diff --git a/TwitchDownloaderWPF/TwitchTasks/ClipDownloadTask.cs b/TwitchDownloaderWPF/TwitchTasks/ClipDownloadTask.cs index b168596c..d0e6bc8e 100644 --- a/TwitchDownloaderWPF/TwitchTasks/ClipDownloadTask.cs +++ b/TwitchDownloaderWPF/TwitchTasks/ClipDownloadTask.cs @@ -159,8 +159,7 @@ public async Task RunAsync() CanReinitialize = true; } TokenSource.Dispose(); - GC.Collect(); - GC.WaitForPendingFinalizers(); + GC.Collect(-1, GCCollectionMode.Default, false); } private void OnPropertyChanged([CallerMemberName] string propertyName = null) diff --git a/TwitchDownloaderWPF/TwitchTasks/VodDownloadTask.cs b/TwitchDownloaderWPF/TwitchTasks/VodDownloadTask.cs index 8c8bf252..aefbba88 100644 --- a/TwitchDownloaderWPF/TwitchTasks/VodDownloadTask.cs +++ b/TwitchDownloaderWPF/TwitchTasks/VodDownloadTask.cs @@ -159,8 +159,7 @@ public async Task RunAsync() CanReinitialize = true; } TokenSource.Dispose(); - GC.Collect(); - GC.WaitForPendingFinalizers(); + GC.Collect(-1, GCCollectionMode.Default, false); } private void OnPropertyChanged([CallerMemberName] string propertyName = null)