修复无法正确卸载dll

This commit is contained in:
hugy 2023-02-21 16:24:39 +08:00
parent 04e7967236
commit 861a04e7a0
4 changed files with 10 additions and 1 deletions

View File

@ -136,3 +136,10 @@ BOOL FindOrCreateDirectoryW(const wchar_t *path) {
}
return true;
}
void CloseConsole(){
fclose(stdin);
fclose(stdout);
fclose(stderr);
FreeConsole();
}

View File

@ -53,6 +53,7 @@ std::string Wstring2String(std::wstring wstr);
/// @return
BOOL FindOrCreateDirectoryW(const wchar_t *path);
void CloseConsole();
template <typename T1, typename T2>
std::vector<T1> split(T1 str, T2 letter) {

View File

@ -16,6 +16,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call,
break;
}
case DLL_PROCESS_DETACH: {
CloseConsole();
http_close();
break;
}