Boost C++ Libraries: Ticket #3702: asio & ssl - leaking io_handlers after boost::asio::io_service object is stopped and destroyed https://svn.boost.org/trac10/ticket/3702 <p> The way boost::asio::ssl::detail::openssl_stream_service is implemented requires that function handler_impl() has to be called before io_handler objects can be deleted. However when the io_service object is stopped and later destroyed, the handlers for those pending SSL operations will never be called, thus causing the leak. </p> <p> Since I am binding shared_ptr&lt;ssl_session&gt;s into my SSL handlers, this leak will also keep alive my SSL session objects. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3702 Trac 1.4.3 tianhao.qiu@… Wed, 02 Dec 2009 22:54:40 GMT attachment set https://svn.boost.org/trac10/ticket/3702 https://svn.boost.org/trac10/ticket/3702 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patch</span> </li> </ul> Ticket tianhao.qiu@… Wed, 02 Dec 2009 23:15:28 GMT <link>https://svn.boost.org/trac10/ticket/3702#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3702#comment:1</guid> <description> <p> Patch submitted. </p> <p> The old design deletes the handler (io_handler/handshake_handler/shutdown_handler) and openssl_operation objects in the handler_impl() function. However pending handler_impl() functions are not invoked when the io_service object is stopped, thus causing the leak. </p> <p> The patch addresses the problem by wrapping the handler and openssl_operation objects in shared_ptrs. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Mon, 06 Jun 2011 01:55:25 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3702#comment:2 https://svn.boost.org/trac10/ticket/3702#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> As of <a class="changeset" href="https://svn.boost.org/trac10/changeset/72428" title="Merge asio from trunk.">[72428]</a>, the release branch contains the new SSL implementation that addresses this. </p> Ticket