This makes me nervous. Lets review tomorrow what the lifetime is here. I feel like you are deleting the listener out from under the running thread. Calling delete on a thread doesn't terminate it, I think. Normally, you should join a  thread, but since listener doesn't provide a way to terminate, it is a problem. Can add a print statement to the end of TestListener::operator() to see if initAndListen ever returns?