Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix use-after-free in timertest
There is a bug in the test, which sometimes causes a use-after-free to be reported by the sanitizer in the debug build. The problem is that the callback is an std::function held inside the t1 object, and when the callback deletes t1, it also deletes the std::function being executed. In commit 902d5b2 we had exactly the same bug in the sleep() function, and the same fix works here too: free t1 only after the future has returned, since by that time we know the callback is done. Fixes #77 Tested-by: Vlad Zolotarov <[email protected]> Signed-off-by: Nadav Har'El <[email protected]>
- Loading branch information