From: <bo...@us...> - 2009-04-30 11:15:38
|
Revision: 305 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=305&view=rev Author: bodewig Date: 2009-04-30 11:15:28 +0000 (Thu, 30 Apr 2009) Log Message: ----------- XmlReader is not IDisposable in .NET 1.1 Modified Paths: -------------- branches/xmlunit-1.x/src/csharp/XmlDiff.cs Modified: branches/xmlunit-1.x/src/csharp/XmlDiff.cs =================================================================== --- branches/xmlunit-1.x/src/csharp/XmlDiff.cs 2009-04-30 10:37:32 UTC (rev 304) +++ branches/xmlunit-1.x/src/csharp/XmlDiff.cs 2009-04-30 11:15:28 UTC (rev 305) @@ -50,11 +50,24 @@ public DiffResult Compare() { if (_diffResult == null) { _diffResult = new DiffResult(); - using (XmlReader controlReader = CreateXmlReader(controlInput)) - using (XmlReader testReader = CreateXmlReader(testInput)) { + XmlReader controlReader, testReader; + controlReader = testReader = null; + try { + controlReader = CreateXmlReader(controlInput); + testReader = CreateXmlReader(testInput); if (!controlInput.Equals(testInput)) { Compare(_diffResult, controlReader, testReader); } + } finally { + try { + if (testReader != null) { + testReader.Close(); + } + } finally { + if (controlReader != null) { + controlReader.Close(); + } + } } } return _diffResult; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |