mirror of
https://github.com/alicealys/t5-gsc-utils.git
synced 2025-04-19 20:42:54 +00:00
Small fix
This commit is contained in:
parent
1cd309f299
commit
2e653dbbbf
@ -12,6 +12,7 @@ namespace scheduler
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
utils::hook::detour server_frame_hook;
|
utils::hook::detour server_frame_hook;
|
||||||
|
bool kill_thread = false;
|
||||||
|
|
||||||
struct task
|
struct task
|
||||||
{
|
{
|
||||||
@ -143,7 +144,7 @@ namespace scheduler
|
|||||||
{
|
{
|
||||||
thread = std::thread([]()
|
thread = std::thread([]()
|
||||||
{
|
{
|
||||||
while (true)
|
while (!kill_thread)
|
||||||
{
|
{
|
||||||
execute(pipeline::async);
|
execute(pipeline::async);
|
||||||
std::this_thread::sleep_for(10ms);
|
std::this_thread::sleep_for(10ms);
|
||||||
@ -152,6 +153,16 @@ namespace scheduler
|
|||||||
|
|
||||||
server_frame_hook.create(SELECT_VALUE(0x43E340, 0x46B680), server_frame_stub);
|
server_frame_hook.create(SELECT_VALUE(0x43E340, 0x46B680), server_frame_stub);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pre_destroy() override
|
||||||
|
{
|
||||||
|
kill_thread = true;
|
||||||
|
|
||||||
|
if (thread.joinable())
|
||||||
|
{
|
||||||
|
thread.join();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,5 +13,10 @@ BOOL APIENTRY DllMain(HMODULE /*module_*/, DWORD ul_reason_for_call, LPVOID /*re
|
|||||||
component_loader::post_unpack();
|
component_loader::post_unpack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ul_reason_for_call == DLL_PROCESS_DETACH)
|
||||||
|
{
|
||||||
|
component_loader::pre_destroy();
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user