File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 " +
You can’t perform that action at this time.
0 commit comments