svnno****@sourc*****
svnno****@sourc*****
2009年 6月 8日 (月) 19:22:00 JST
Revision: 3450 http://svn.sourceforge.jp/view?root=ttssh2&view=rev&rev=3450 Author: doda Date: 2009-06-08 19:22:00 +0900 (Mon, 08 Jun 2009) Log Message: ----------- ロケールオブジェクトがリークしていたのを修正。 Modified Paths: -------------- trunk/teraterm/teraterm/vtterm.c trunk/teraterm/teraterm/vtterm.h trunk/teraterm/teraterm/vtwin.cpp -------------- next part -------------- Modified: trunk/teraterm/teraterm/vtterm.c =================================================================== --- trunk/teraterm/teraterm/vtterm.c 2009-06-08 05:20:01 UTC (rev 3449) +++ trunk/teraterm/teraterm/vtterm.c 2009-06-08 10:22:00 UTC (rev 3450) @@ -117,7 +117,7 @@ static BYTE NewKeyStr[FuncKeyStrMax]; static int NewKeyId, NewKeyLen; -static _locale_t CLocale; +static _locale_t CLocale = NULL; void ResetSBuffers() { @@ -174,7 +174,9 @@ FocusReportMode = FALSE; MouseReportMode = IdMouseTrackNone; - CLocale = _create_locale(LC_ALL, "C"); + if (CLocale == NULL) { + CLocale = _create_locale(LC_ALL, "C"); + } /* Character sets */ ResetCharSet(); @@ -3550,3 +3552,10 @@ Sleep(10); CSQExchangeColor(); } + +void EndTerm() { + if (CLocale) { + _free_locale(CLocale); + } + CLocale = NULL; +} Modified: trunk/teraterm/teraterm/vtterm.h =================================================================== --- trunk/teraterm/teraterm/vtterm.h 2009-06-08 05:20:01 UTC (rev 3449) +++ trunk/teraterm/teraterm/vtterm.h 2009-06-08 10:22:00 UTC (rev 3450) @@ -18,6 +18,7 @@ int VTParse(); void FocusReport(BOOL Focus); BOOL MouseReport(int Event, int Button, int Xpos, int Ypos); +void EndTerm(); #ifdef __cplusplus } Modified: trunk/teraterm/teraterm/vtwin.cpp =================================================================== --- trunk/teraterm/teraterm/vtwin.cpp 2009-06-08 05:20:01 UTC (rev 3449) +++ trunk/teraterm/teraterm/vtwin.cpp 2009-06-08 10:22:00 UTC (rev 3450) @@ -1730,6 +1730,7 @@ ::DestroyWindow(HTEKWin); } + EndTerm(); EndDisp(); FreeBuffer();