[Ttssh2-commit] [4503] アイコンリソースの開放漏れを修正

svnno****@sourc***** svnno****@sourc*****
2011年 6月 16日 (木) 00:16:58 JST


Revision: 4503
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4503
Author:   maya
Date:     2011-06-16 00:16:57 +0900 (Thu, 16 Jun 2011)

Log Message:
-----------
アイコンリソースの開放漏れを修正
  http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=25417

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/history.html
    trunk/ttpmenu/ttpmenu.cpp


-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2011-06-15 14:14:18 UTC (rev 4502)
+++ trunk/doc/en/html/about/history.html	2011-06-15 15:16:57 UTC (rev 4503)
@@ -67,6 +67,7 @@
           <li>Bug fix: When the CygTerm Here is added in the context menu, the CygTerm Here does not work well with the folder name containing continuing spaces.</li>
         </ul></li>
       <li>upgraded TTSSH version supporting SSH2 to <a href="#ttssh_2.57">2.57</a></li>
+      <li>upgraded TeraTerm Menu to <a href="#ttmenu_1.10">1.10</a></li>
       <li>upgraded CygTerm+ to <a href="#cygterm_1.07_23">1.07_23</a></li>
       <li>upgraded cyglaunch to <a href="#cyglaunch_1.03">1.03</a></li>
     </ul>
@@ -2630,6 +2631,11 @@
 
 <h2><a name="ttmenu">TeraTerm Menu</a></h2>
 
+<h3><a name="ttmenu_1.10">2011.x.x (Ver 1.10)</a></h3>
+<ul class="history">
+      <!--li>ƒAƒCƒRƒ“ƒŠƒ\[ƒX‚ÌŠJ•ú˜R‚ê‚ðC³‚µ‚½B</li-->
+</ul>
+
 <h3><a name="ttmenu_1.09">2009.7.5 (Ver 1.09)</a></h3>
 <ul class="history">
       <li>added support for changing TTSSH command line specification.</li>

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2011-06-15 14:14:18 UTC (rev 4502)
+++ trunk/doc/ja/html/about/history.html	2011-06-15 15:16:57 UTC (rev 4503)
@@ -67,6 +67,7 @@
           <li>ƒtƒHƒ‹ƒ_‚̃Rƒ“ƒeƒLƒXƒgƒƒjƒ…[‚É CygTerm Here ‚ð’ljÁ‚µ‚½ŽžA–¼‘O‚É•¡”‚̘A‘±‚·‚éƒXƒy[ƒX‚ðŠÜ‚ÞƒtƒHƒ‹ƒ_‚Ö‚Ì CygTerm Here ‚ª³‚µ‚­“­‚©‚È‚¢‚Ì‚ðC³‚µ‚½B</li>
         </ul></li>
       <li><a href="#ttssh_2.57">SSH2‘ΉžTTSSH(2.57)</a>‚֍·‚µ‘Ö‚¦‚½B</li>
+      <li><a href="#ttmenu_1.10">TeraTerm Menu(1.10)</a>‚֍·‚µ‘Ö‚¦‚½B</li>
       <li><a href="#cygterm_1.07_23">CygTerm+ 1.07_23</a>‚֍·‚µ‘Ö‚¦‚½B</li>
       <li><a href="#cyglaunch_1.03">cyglaunch (1.03)</a>‚֍·‚µ‘Ö‚¦‚½B</li>
     </ul>
@@ -2633,6 +2634,11 @@
 
 <h2><a name="ttmenu">TeraTerm Menu</a></h2>
 
+<h3><a name="ttmenu_1.10">2011.x.x (Ver 1.10)</a></h3>
+<ul class="history">
+      <li>ƒAƒCƒRƒ“ƒŠƒ\[ƒX‚ÌŠJ•ú˜R‚ê‚ðC³‚µ‚½B</li>
+</ul>
+
 <h3><a name="ttmenu_1.09">2009.7.5 (Ver 1.09)</a></h3>
 <ul class="history">
       <li>TTSSH ‚̃Rƒ}ƒ“ƒhƒ‰ƒCƒ“Žd—l•ÏX‚ɑΉž‚µ‚½B</li>

Modified: trunk/ttpmenu/ttpmenu.cpp
===================================================================
--- trunk/ttpmenu/ttpmenu.cpp	2011-06-15 14:14:18 UTC (rev 4502)
+++ trunk/ttpmenu/ttpmenu.cpp	2011-06-15 15:16:57 UTC (rev 4503)
@@ -1385,6 +1385,34 @@
 }
 
 /* ==========================================================================
+	Function Name	: (VOID) DeleteListMenuIcons()
+	Outline			: SHGetFileInfo ‚ÅŽæ‚èo‚µ‚½ƒAƒCƒRƒ“ƒŠƒ\[ƒX‚ðŠJ•ú‚·‚éB
+	                  ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚ƈꗗ•\Ž¦‚ÅŽg—p‚·‚邽‚߁A
+	                  ŠJ•ú‚Å‚«‚é‚͈̂ꗗXV’¼‘O‚ƃvƒƒOƒ‰ƒ€I—¹ŽžB
+	Arguments		: 
+	Return Value	: 
+	Reference		: 
+	Renewal			: 
+	Notes			: 
+	Attention		: 
+	Up Date			: 
+   ======1=========2=========3=========4=========5=========6=========7======= */
+VOID DeleteListMenuIcons()
+{
+	for (int cnt = 0; cnt < MAXJOBNUM; cnt++) {
+		memset(g_MenuData.szName, 0, MAX_PATH);
+		if (g_MenuData.hLargeIcon[cnt] != NULL) {
+			::DestroyIcon(g_MenuData.hLargeIcon[cnt]);
+			g_MenuData.hLargeIcon[cnt] = NULL;
+		}
+		if (g_MenuData.hSmallIcon[cnt] != NULL) {
+			::DestroyIcon(g_MenuData.hSmallIcon[cnt]);
+			g_MenuData.hSmallIcon[cnt] = NULL;
+		}
+	}
+}
+
+/* ==========================================================================
 	Function Name	: (BOOL) InitListMenu()
 	Outline			: Ý’èˆê——ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚ð‰Šú‰»‚·‚éB
 	Arguments		: HWND		hWnd		(In) ƒEƒCƒ“ƒhƒE‚̃nƒ“ƒhƒ‹
@@ -1404,17 +1432,7 @@
 	DWORD	dwIndex = 0;
 	DWORD	dwSize = MAX_PATH;
 
-	for (int cnt = 0; cnt < MAXJOBNUM; cnt++) {
-		memset(g_MenuData.szName, 0, MAX_PATH);
-		if (g_MenuData.hLargeIcon[cnt] != NULL) {
-			::DestroyIcon(g_MenuData.hLargeIcon[cnt]);
-			g_MenuData.hLargeIcon[cnt] = NULL;
-		}
-		if (g_MenuData.hSmallIcon[cnt] != NULL) {
-			::DestroyIcon(g_MenuData.hSmallIcon[cnt]);
-			g_MenuData.hSmallIcon[cnt] = NULL;
-		}
-	}
+	DeleteListMenuIcons();
 
 	if ((hKey = RegOpen(HKEY_CURRENT_USER, TTERM_KEY)) != INVALID_HANDLE_VALUE) {
 		while (RegEnumEx(hKey, dwIndex, szEntryName, &dwSize, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
@@ -2480,6 +2498,7 @@
 		SaveConfig();
 		SetTaskTray(hWnd, NIM_DELETE);
 		::UnregisterHotKey(hWnd, WM_MENUOPEN);
+		DeleteListMenuIcons();
 		::DestroyMenu(g_hListMenu);
 		::DestroyMenu(g_hMenu);
 		::PostQuitMessage(0);



Ttssh2-commit メーリングリストの案内