<snip>
So, my question is: does ASIO give a guarantee that it destroys the completion handler after the preceding operations have finished?
Asio will perform the following operations when about to invoke a completion handler: - extract the handler from its surrounding async operation via std::move (assuming C++11 or better, otherwise it copies it). - destroy/deallocate any dynamic state in the async operation. - invoke the handler. - destroy the handler. This assumes that the completion handler is invoked prior to the destruction of the execution context with which it is associated (the normal case). In the corner case of the execution context being destroyed, all outstanding async operations (which would include pending completion handlers) are destroyed.
Regards, &rzej;
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost