static ULONG WINAPI xmlwriteroutput_Release(IXmlWriterOutput *iface) { xmlwriteroutput *This = impl_from_IXmlWriterOutput(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p)->(%d)\n", This, ref); if (ref == 0) { IMalloc *imalloc = This->imalloc; if (This->output) IUnknown_Release(This->output); if (This->stream) ISequentialStream_Release(This->stream); free_output_buffer(This); writeroutput_free(This, This); if (imalloc) IMalloc_Release(imalloc); } return ref; }
static ULONG WINAPI mxwriter_Release(IMXWriter *iface) { mxwriter *This = impl_from_IMXWriter( iface ); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p)->(%d)\n", This, ref); if(!ref) { /* Windows flushes the buffer when the interface is destroyed. */ flush_output_buffer(This); free_output_buffer(This->buffer); if (This->dest) IStream_Release(This->dest); SysFreeString(This->version); SysFreeString(This->encoding); SysFreeString(This->element); release_dispex(&This->dispex); heap_free(This); } return ref; }