
Hello,
I'm trying to open a boost::iostreams::stream in the constructor of a
class and to close the stream in the destructor. This works fine but
when I pass a reference to a std::stringstream in that same constructor
I get a segmentation fault in the destructor when I flush or close the
stream. This happens irrespective if the passed std::stringstream
reference takes part in the boost::iostream::stream or not.
I'm using gcc 4.6.3 with boost 1.53 on Linux x86_64.
Below I provided a small example that exhibits this behaviour.
Any ideas anyone?
#include "test.h"
int main(int argc, char **argv) {
std::stringstream logStream;
Test test(logStream);
return 0;
}
where test.h contains:
#include <fstream>
#include <sstream>
#include