Boost C++ Libraries: Ticket #1137: Virtual destructor is missing https://svn.boost.org/trac10/ticket/1137 <p> The destructor of polymorphic_xml_oarchive gets never called when deleted through polymorphic_oarchive. I posted this to the users list and Robert Ramey already had a solution but it seems to not have made it into 1.34.1 :-( </p> <p> The result of this is a memory leak and a missing &lt;/boost_serialization&gt; tag at the end of the stringstream in the following example: </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;sstream&gt; #include &lt;boost/archive/polymorphic_oarchive.hpp&gt; #include &lt;boost/archive/polymorphic_xml_oarchive.hpp&gt; void main(int argc, char** argv) { std::ostringstream buffer; boost::archive::polymorphic_oarchive* archive_interface; archive_interface = new boost::archive::polymorphic_xml_oarchive(buffer); delete archive_interface; buffer.flush(); std::cout &lt;&lt; buffer.str(); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1137 Trac 1.4.3 Robert Ramey Fri, 30 Nov 2007 05:05:20 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1137#comment:1 https://svn.boost.org/trac10/ticket/1137#comment:1 <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> Ticket