The cause of the problem is that ~SimpleDispatchThread() detaches the event loop thread when it is called from within that thread. The detached thread will be destroyed at an arbitrary point in the future. In some cases the thread is not yet destroyed when the process is forked in the next test (keeps_dispatching_after_signal_interruption), so valgrind assumes that we have leaked its memory.
The cause of the problem is that ~SimpleDispatch Thread( ) detaches the event loop thread when it is called from within that thread. The detached thread will be destroyed at an arbitrary point in the future. In some cases the thread is not yet destroyed when the process is forked in the next test (keeps_ dispatching_ after_signal_ interruption) , so valgrind assumes that we have leaked its memory.