|
@@ -78,8 +78,10 @@ namespace Google.ProtocolBuffers.Serialization
|
|
{
|
|
{
|
|
if (disposing)
|
|
if (disposing)
|
|
{
|
|
{
|
|
- while(_messageOpenCount > 0)
|
|
|
|
|
|
+ while (_messageOpenCount > 0)
|
|
|
|
+ {
|
|
WriteMessageEnd();
|
|
WriteMessageEnd();
|
|
|
|
+ }
|
|
|
|
|
|
_output.Close();
|
|
_output.Close();
|
|
}
|
|
}
|
|
@@ -163,7 +165,9 @@ namespace Google.ProtocolBuffers.Serialization
|
|
public override void WriteMessageEnd()
|
|
public override void WriteMessageEnd()
|
|
{
|
|
{
|
|
if (_messageOpenCount <= 0)
|
|
if (_messageOpenCount <= 0)
|
|
|
|
+ {
|
|
throw new InvalidOperationException();
|
|
throw new InvalidOperationException();
|
|
|
|
+ }
|
|
|
|
|
|
_output.WriteEndElement();
|
|
_output.WriteEndElement();
|
|
_output.Flush();
|
|
_output.Flush();
|