From f294cea0c323696e57f404d5c8be702d42f90c90 Mon Sep 17 00:00:00 2001 From: anis774 Date: Fri, 10 Sep 2010 04:17:44 +0000 Subject: [PATCH] =?utf8?q?=E7=B5=82=E4=BA=86=E5=87=A6=E7=90=86=E3=81=AEIma?= =?utf8?q?geCacheDictionary=E3=81=AE=E5=BE=8C=E5=A7=8B=E6=9C=AB=E3=81=AB?= =?utf8?q?=E7=84=A1=E9=A7=84=E3=81=AA=E3=82=B3=E3=83=BC=E3=83=89=E3=83=91?= =?utf8?q?=E3=82=B9=E3=81=8C=E3=81=82=E3=81=A3=E3=81=9F=E3=81=AE=E3=82=92?= =?utf8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@842 e39ad16e-3079-482e-bb30-4b4d378143b6 --- Tween/ImageCacheDictionary.vb | 7 ++++++- Tween/Tween.vb | 8 +------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Tween/ImageCacheDictionary.vb b/Tween/ImageCacheDictionary.vb index 723020af..61881226 100644 --- a/Tween/ImageCacheDictionary.vb +++ b/Tween/ImageCacheDictionary.vb @@ -178,7 +178,12 @@ Public Class ImageCacheDictionary Public ReadOnly Property Image As Image Get If Me.img Is Nothing Then - Me.img = Image.FromFile(Me.tmpFilePath) + Try + Me.img = Image.FromFile(Me.tmpFilePath) + Catch ex As OutOfMemoryException + File.Copy(Me.tmpFilePath, Path.Combine(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), "TweenCache"), Path.GetFileName(Me.tmpFilePath))) + Throw ex + End Try End If Return Me.img diff --git a/Tween/Tween.vb b/Tween/Tween.vb index 5e798df0..7fab3e81 100644 --- a/Tween/Tween.vb +++ b/Tween/Tween.vb @@ -319,12 +319,6 @@ Public Class TweenMain fDialog.Dispose() UrlDialog.Dispose() _spaceKeyCanceler.Dispose() - If TIconDic IsNot Nothing AndAlso TIconDic.Keys.Count > 0 Then - For Each key As String In TIconDic.Keys - TIconDic(key).Dispose() - Next - TIconDic.Clear() - End If DirectCast(TIconDic, IDisposable).Dispose() If NIconAt IsNot Nothing Then NIconAt.Dispose() If NIconAtRed IsNot Nothing Then NIconAtRed.Dispose() @@ -987,7 +981,7 @@ Public Class TweenMain End If 'アイコンリスト作成 - TIconDic = New ImageCacheDictionary(3000) + TIconDic = New ImageCacheDictionary(50) tw.DetailIcon = TIconDic -- 2.11.0