Revision: 7949 https://osdn.net/projects/ttssh2/scm/svn/commits/7949 Author: zmatsuo Date: 2019-08-13 22:38:22 +0900 (Tue, 13 Aug 2019) Log Message: ----------- ttxsshビルド時マクロ再定義警告が出ないようにした - ttxsshでは、CRTDBG_MAP_ALLOC が define されているため - _beginthreadex()がエラーを返したときResumeThread()しないようにした Modified Paths: -------------- trunk/teraterm/teraterm/WSAAsyncGetAddrInfo.c -------------- next part -------------- Modified: trunk/teraterm/teraterm/WSAAsyncGetAddrInfo.c =================================================================== --- trunk/teraterm/teraterm/WSAAsyncGetAddrInfo.c 2019-08-13 13:18:05 UTC (rev 7948) +++ trunk/teraterm/teraterm/WSAAsyncGetAddrInfo.c 2019-08-13 13:38:22 UTC (rev 7949) @@ -48,7 +48,7 @@ HANDLE *lpHandle; }; -#ifdef _DEBUG +#if defined(_DEBUG) && !defined(_CRTDBG_MAP_ALLOC) #define malloc(l) _malloc_dbg((l), _NORMAL_BLOCK, __FILE__, __LINE__) #define free(p) _free_dbg((p), _NORMAL_BLOCK) #define _strdup(s) _strdup_dbg((s), _NORMAL_BLOCK, __FILE__, __LINE__) @@ -90,18 +90,18 @@ /* create sub-thread running getaddrinfo() */ thread = (HANDLE)_beginthreadex(NULL, 0, getaddrinfo_thread, ga, CREATE_SUSPENDED, &tid); - *ga->lpHandle = thread; - ResumeThread(thread); - - /* return thread handle */ if (thread == 0) { free(ga->lpHandle); free(ga->hostname); free(ga->portname); free(ga); - return NULL; - } else - return thread; + return NULL; // return error + } + + /* return thread handle */ + *ga->lpHandle = thread; + ResumeThread(thread); + return thread; } static unsigned __stdcall getaddrinfo_thread(void * p)