Closed rmalizia44 closed 3 years ago
uvw
doesn't close handles for the user. It stays true to how libuv
works and therefore you have to close them.
That's one of the reasons for which the handle itself is passed back to the listeners. You must invoke .close
when you receive a TimerEvent
to observe the desired behavior.
I assume this was answered and therefore I'm closing the issue. Feel free to continue the discussion here if needed. Thanks.
Hi, I've discovered that if you create a TimerHandle and start it and its repeat value is zero, the timer will stop after the first callback, will leave the loop, will not call the CloseEvent and will not release it's data shared_ptr. I've made a minimal example that replicate the bug:
Expected Output:
But I've got this:
Compiled with MinGW32 Windows x64 g++
g++ -o test ./test.cpp -Wall -Werror -I. -std=c++17 -luv && ./test
Sorry for the unconvenience but I'm relatively new to uvw