mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-21 19:30:26 +08:00
avoid collapse when quit (msvc)
This commit is contained in:
parent
7e9f3ca9f2
commit
4174a18343
@ -36,12 +36,14 @@ namespace Qv2ray::components::latency
|
||||
if (!requests.empty())
|
||||
requests.clear();
|
||||
int timer_count = 0;
|
||||
//LOG(MODULE_NETWORK,"fuck")
|
||||
loop->walk([&timer_count,this](uvw::BaseHandle&h)
|
||||
{
|
||||
if(!h.closing())
|
||||
timer_count++;
|
||||
});
|
||||
uv_walk(
|
||||
loop->raw(),
|
||||
[](uv_handle_t *handle, void *arg) {
|
||||
int &counter = *static_cast<int *>(arg);
|
||||
if (uv_is_closing(handle) == 0)
|
||||
counter++;
|
||||
},
|
||||
&timer_count);
|
||||
if (timer_count == 1) // only current timer
|
||||
{
|
||||
handle.stop();
|
||||
|
Loading…
Reference in New Issue
Block a user