Revision: 7655 https://osdn.net/projects/ttssh2/scm/svn/commits/7655 Author: zmatsuo Date: 2019-05-08 01:47:13 +0900 (Wed, 08 May 2019) Log Message: ----------- 未使用変数の削除、不要な変数代入削除、WindowハンドルがNULLの時API呼び出しを行わないよう修正 Modified Paths: -------------- trunk/teraterm/common/tmfc.cpp -------------- next part -------------- Modified: trunk/teraterm/common/tmfc.cpp =================================================================== --- trunk/teraterm/common/tmfc.cpp 2019-05-07 16:46:48 UTC (rev 7654) +++ trunk/teraterm/common/tmfc.cpp 2019-05-07 16:47:13 UTC (rev 7655) @@ -554,14 +554,10 @@ pseudoPtr = nullptr; if (hWnd == nullptr) { -#if defined(_DEBUG) - DWORD e = GetLastError(); -#endif assert(false); return FALSE; } - m_hParentWnd = hParent; m_hWnd = hWnd; m_hInst = hInstance; // ::EnableWindow(hParent,FALSE); @@ -617,8 +613,10 @@ { if (m_hWnd != nullptr) { HWND hWnd; - ::EnableWindow(m_hParentWnd,TRUE); - ::SetFocus(m_hParentWnd); + if (m_hParentWnd != nullptr) { + ::EnableWindow(m_hParentWnd,TRUE); + ::SetFocus(m_hParentWnd); + } hWnd = m_hWnd; m_hWnd = nullptr; ::DestroyWindow(hWnd);