Skip to content

Commit 23ccc83

Browse files
committed
chore: More GC.Collect();
1 parent 648d12d commit 23ccc83

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

WndMain.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ public WndMain()
4545
// 加载摄像头设备
4646
private void CameraDevicesLoad()
4747
{
48+
// 顺便释放点垃圾
49+
GC.Collect();
50+
51+
// 清空下拉列表
4852
cameraComboBox.Items.Clear();
4953
bool _cameraFound = false;
5054
foreach (var i in FindCamera.EnumDevices.Devices)
@@ -79,7 +83,7 @@ private void LoadFaceCascade(string fileName)
7983
{
8084
faceCascade.Dispose();
8185
faceCascade = null;
82-
System.GC.Collect();
86+
GC.Collect();
8387
}
8488

8589
string xmlPath = Path.Combine(Application.StartupPath, "cascades/", fileName);
@@ -317,6 +321,9 @@ private void machineStatusTimer_Tick(object sender, EventArgs e)
317321
// 关于
318322
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
319323
{
324+
// 顺便垃圾回收下
325+
GC.Collect();
326+
320327
TaskDialogPage page = new TaskDialogPage()
321328
{
322329
Text = "这是一个启发于某沃基于人脸识别随机抽人的玩具\n" +

0 commit comments

Comments
 (0)