0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-31 00:13:01 +08:00

Explicitly call xml_buffered_writer::flush()

If xml_writer::write throws an exception while being called from flush(), the
exception is thrown from destructor. Clang in C++11 mode calls std::terminate
in this case.
This commit is contained in:
Arseny Kapoulkine 2015-04-14 19:11:26 -07:00
parent e977f04fe2
commit 2badcbb674

View File

@ -3115,11 +3115,6 @@ PUGI__NS_BEGIN
PUGI__STATIC_ASSERT(bufcapacity >= 8);
}
~xml_buffered_writer()
{
flush();
}
size_t flush()
{
flush(buffer, bufsize);
@ -5496,6 +5491,8 @@ namespace pugi
impl::xml_buffered_writer buffered_writer(writer, encoding);
impl::node_output(buffered_writer, _root, indent, flags, depth);
buffered_writer.flush();
}
#ifndef PUGIXML_NO_STL
@ -6205,6 +6202,8 @@ namespace pugi
}
impl::node_output(buffered_writer, _root, indent, flags, 0);
buffered_writer.flush();
}
#ifndef PUGIXML_NO_STL