Paul Giaccone wrote:
How do you close a filtering_ostream object once you have finished writing to it?
I tried calling out.reset() to the filtering_ostream object. This has the desired effect, as the data is written to file before "out" falls out of scope, but then when the end of the scope is reached, my program crashes in the destructor. If this is not the right way to flush the stream, what should I be doing instead? I tried strict_sync() but this returned false because it looks as though the compressor is not flushable (although I could not find anything about this in the documentation). I am working in Visual Studio .NET 7.1. Call stack:
MyProgram.exe!std::locale::locale(const std::locale & _Right={...}) Line 231 + 0x29 C++ MyProgram.exe!std::basic_streambuf
MyProgram.exe!boost::io::basic_ios_locale_saver ::restore() Line 241 + 0x1e C++ MyProgram.exe!boost::io::basic_ios_locale_saver ::~basic_ios_locale_saver MyProgram.exe!boost::archive::basic_text_oprimitive ::~basic_text_oprimitive () Line 105 + 0xf C++ MyProgram.exe!boost::archive::text_oarchive_implboost::archive::text_oarchive::~text_oarchive_implboost::archive::text_oarchive()
Line 72 + 0x80 C++
MyProgram.exe!boost::archive::text_oarchive::~text_oarchive() Line
89 + 0x34 C++
MyProgram.exe!MyClass::save(const
std::basic_string