[PR #946] [CLOSED] refactor: Improve codes of BaseCapture.cs #1267

Closed
opened 2026-02-26 09:34:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/NickeManarin/ScreenToGif/pull/946
Author: @SEWeiTung
Created: 7/17/2021
Status: Closed

Base: devHead: dev


📝 Commits (1)

  • 9f291b8 refactor: Improve codes of BaseCapture.cs

📊 Changes

1 file changed (+53 additions, -15 deletions)

View changed files

📝 ScreenToGif/Capture/BaseCapture.cs (+53 -15)

📄 Description

  1. Add a protected Dispose to controll whether it's manually called
    or called by destructor function, because we don't need to GC again.

  2. Release all the managed things.

  3. Remove "Wait()" for "~BaseCapture()", we CANNOT block the finalizer
    thread running background. Because when come to it, the object itself is
    broken and useless, we don't need to care about the result, so directly
    calling "Dispose(false)" is enough.

  4. Auto reformat codes and save to UTF-8 (without BOM).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/NickeManarin/ScreenToGif/pull/946 **Author:** [@SEWeiTung](https://github.com/SEWeiTung) **Created:** 7/17/2021 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (1) - [`9f291b8`](https://github.com/NickeManarin/ScreenToGif/commit/9f291b816985b9387289e6886ecbf8c5a22b3d63) refactor: Improve codes of BaseCapture.cs ### 📊 Changes **1 file changed** (+53 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `ScreenToGif/Capture/BaseCapture.cs` (+53 -15) </details> ### 📄 Description 1. Add a protected Dispose to controll whether it's manually called or called by destructor function, because we don't need to GC again. 2. Release all the managed things. 3. Remove "Wait()" for "~BaseCapture()", we CANNOT block the finalizer thread running background. Because when come to it, the object itself is broken and useless, we don't need to care about the result, so directly calling "Dispose(false)" is enough. 4. Auto reformat codes and save to UTF-8 (without BOM). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 09:34:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#1267
No description provided.