OSDN Git Service

起動時の設定保存処理は必要にな時のみ実行するよう変更
authorkiri_feather <kiri_feather@users.sourceforge.jp>
Tue, 25 May 2010 13:52:00 +0000 (13:52 +0000)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 18 Feb 2012 14:12:49 +0000 (23:12 +0900)
定期定期なGC.Collectを追加

git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@375 e39ad16e-3079-482e-bb30-4b4d378143b6

Tween/Tween.vb

index 5f45753..88838db 100644 (file)
@@ -783,8 +783,10 @@ Public Class TweenMain
 
         _initial = True
 
+        Dim saveRequired As Boolean = False
         'ユーザー名、パスワードが未設定なら設定画面を表示(初回起動時など)
         If tw.Username = "" Then
+            saveRequired = True
             '設定せずにキャンセルされた場合はプログラム終了
             If SettingDialog.ShowDialog() = Windows.Forms.DialogResult.Cancel Then
                 Application.Exit()  '強制終了
@@ -1087,7 +1089,7 @@ Public Class TweenMain
         'TimerColorize.Start()
         _ignoreConfigSave = False
         Me.TweenMain_Resize(Nothing, Nothing)
-        SaveConfigsAll(False)
+        If saveRequired Then SaveConfigsAll(False)
     End Sub
 
     Private Sub spaceKeyCanceler_SpaceCancel(ByVal sender As Object, ByVal e As EventArgs)
@@ -7214,6 +7216,13 @@ RETRY:
         If bw Is Nothing Then Exit Sub
 
         bw.RunWorkerAsync(args)
+
+        Static cnt As Integer = 0
+        cnt += 1
+        If cnt > 100 Then
+            GC.Collect()
+            cnt = 0
+        End If
     End Sub
 
     Private Sub TweenMain_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown