On Fri, Jul 2, 2010 at 5:55 PM, Ragnar Cederlund <ragnar.cederlund...> wrote:
I'm having trouble with the io_service destructor never completing.
[...]
I've finally been able to reproduce the hang on my own machine and have a small example that exhibits this problem (built using Visual Studio 2005 in debug mode):
In this example, there is a flaw in that the ConnectCommand is destroyed after the io_service object, but the ConnectCommand has a reference to the io_service.
I would have expected this to lead to a crash or similar and this is indeed the case if I attach a debugger to the program and step through it. But if I just run the program without the debugger attached, the io_service destructor just never completes.
I believe that a variation of the error in the code above is what caused the problems for me and I assume that this should be written off as more or less undefined behavior caused by badly managed object lifetimes.
Thank you all who responded and thank you Sergei for pointing out that there is a specific asio mailing list.