From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/xmllite/tests/writer.c | 2 +- dlls/xmllite/writer.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/dlls/xmllite/tests/writer.c b/dlls/xmllite/tests/writer.c index 760029ee670..b0ea2a54901 100644 --- a/dlls/xmllite/tests/writer.c +++ b/dlls/xmllite/tests/writer.c @@ -708,7 +708,7 @@ static void test_flush(void)
IXmlWriter_Release(writer);
- CHECK_OUTPUT_TODO(stream, "<p:a xmlns:p="uri" />"); + CHECK_OUTPUT(stream, "<p:a xmlns:p="uri" />"); IStream_Release(stream);
/* Resetting output flushes output */ diff --git a/dlls/xmllite/writer.c b/dlls/xmllite/writer.c index 2ac26019c5e..764db383231 100644 --- a/dlls/xmllite/writer.c +++ b/dlls/xmllite/writer.c @@ -248,6 +248,22 @@ static struct element *pop_element(xmlwriter *writer) return element; }
+static HRESULT write_end_element(xmlwriter *writer, const struct element *element); + +static HRESULT writer_end_elements(xmlwriter *writer) +{ + struct element *element; + HRESULT hr = S_OK; + + while (hr == S_OK && (element = pop_element(writer))) + { + hr = write_end_element(writer, element); + writer_free_element(writer, element); + } + + return hr; +} + static WCHAR *writer_strndupW(const xmlwriter *writer, const WCHAR *str, int len) { WCHAR *ret; @@ -820,6 +836,7 @@ static ULONG WINAPI xmlwriter_Release(IXmlWriter *iface) { IMalloc *imalloc = writer->imalloc;
+ writer_end_elements(writer); writeroutput_flush_stream(writer->output); if (writer->output) IUnknown_Release(&writer->output->IXmlWriterOutput_iface);