mirror of
https://github.com/ttttupup/wxhelper.git
synced 2024-11-23 02:39:25 +08:00
修复无法正确卸载dll
This commit is contained in:
parent
04e7967236
commit
861a04e7a0
@ -701,7 +701,7 @@ int http_start(int port) {
|
|||||||
#endif
|
#endif
|
||||||
kHttpRuning = true;
|
kHttpRuning = true;
|
||||||
kHttpThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)http_server,
|
kHttpThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)http_server,
|
||||||
(LPVOID)port, NULL, 0);
|
(LPVOID)port, NULL, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,3 +136,10 @@ BOOL FindOrCreateDirectoryW(const wchar_t *path) {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CloseConsole(){
|
||||||
|
fclose(stdin);
|
||||||
|
fclose(stdout);
|
||||||
|
fclose(stderr);
|
||||||
|
FreeConsole();
|
||||||
|
}
|
@ -53,6 +53,7 @@ std::string Wstring2String(std::wstring wstr);
|
|||||||
/// @return
|
/// @return
|
||||||
BOOL FindOrCreateDirectoryW(const wchar_t *path);
|
BOOL FindOrCreateDirectoryW(const wchar_t *path);
|
||||||
|
|
||||||
|
void CloseConsole();
|
||||||
|
|
||||||
template <typename T1, typename T2>
|
template <typename T1, typename T2>
|
||||||
std::vector<T1> split(T1 str, T2 letter) {
|
std::vector<T1> split(T1 str, T2 letter) {
|
||||||
|
@ -16,6 +16,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DLL_PROCESS_DETACH: {
|
case DLL_PROCESS_DETACH: {
|
||||||
|
CloseConsole();
|
||||||
http_close();
|
http_close();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user