[Boost-bugs] [Boost C++ Libraries] #1137: Virtual destructor is missing

Subject: [Boost-bugs] [Boost C++ Libraries] #1137: Virtual destructor is missing
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-08-03 07:57:27


#1137: Virtual destructor is missing
--------------------------------------------+-------------------------------
 Reporter: anonymous | Owner: ramey
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
  Version: Boost 1.34.1 | Severity: Problem
 Keywords: polymorphic archive destructor |
--------------------------------------------+-------------------------------
 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
 :-(

 The result of this is a memory leak and a missing </boost_serialization>
 tag at the end of the stringstream in the following example:

 {{{
 #include <iostream>
 #include <sstream>

 #include <boost/archive/polymorphic_oarchive.hpp>
 #include <boost/archive/polymorphic_xml_oarchive.hpp>

 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 << buffer.str();
 }
 }}}

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1137>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:56 UTC