Skip to content

Commit

Permalink
Non-blocking GC
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Aug 27, 2024
1 parent fae0ce9 commit 9e09dea
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion TwitchDownloaderWPF/PageChatRender.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
3 changes: 1 addition & 2 deletions TwitchDownloaderWPF/TwitchTasks/ChatDownloadTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion TwitchDownloaderWPF/TwitchTasks/ChatRenderTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions TwitchDownloaderWPF/TwitchTasks/ChatUpdateTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions TwitchDownloaderWPF/TwitchTasks/ClipDownloadTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions TwitchDownloaderWPF/TwitchTasks/VodDownloadTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9e09dea

Please sign in to comment.