Skip to content

Commit 4cc71fd

Browse files
committed
control optimization
1 parent a3ebb68 commit 4cc71fd

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

NVidExtractor/Forms/Form1.vb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,11 @@ Public Class Form1
220220

221221
For Each n As String In killlist
222222
LogForm.addLog("완료 다운로드 삭제 (" + n + ")")
223-
ListPanel.Controls.RemoveByKey(n)
223+
'ListPanel.Controls.RemoveByKey(n)
224+
ListPanel.Controls.Find(n, False).First().Dispose()
224225
Next
226+
227+
GC.Collect()
225228
End If
226229

227230
CheckAndShowTip()
@@ -241,8 +244,11 @@ Public Class Form1
241244

242245
For Each n As String In killlist
243246
LogForm.addLog("일괄 다운로드 삭제 (" + n + ")")
244-
ListPanel.Controls.RemoveByKey(n)
247+
'ListPanel.Controls.RemoveByKey(n)
248+
ListPanel.Controls.Find(n, False).First().Dispose()
245249
Next
250+
251+
GC.Collect()
246252
End If
247253

248254
CheckAndShowTip()
@@ -266,7 +272,9 @@ Public Class Form1
266272
#End Region
267273

268274
Private Sub ctrl_RemoveClicked(sender As Object, e As EventArgs)
269-
ListPanel.Controls.Remove(DirectCast(sender, Control))
275+
DirectCast(sender, Control).Dispose()
276+
GC.Collect()
277+
270278
CheckAndShowTip()
271279
End Sub
272280

0 commit comments

Comments
 (0)