[mapguide-commits] r8086 - trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Apr 29 04:22:48 PDT 2014


Author: jng
Date: 2014-04-29 04:22:48 -0700 (Tue, 29 Apr 2014)
New Revision: 8086

Modified:
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlReaderBase.cs
Log:
#2432: Fix case where the HttpWebResponse could dangle because the XmlReaderBase ctor threw an exception. Patch by John Galambos. Reviewed by me.

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlReaderBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlReaderBase.cs	2014-04-29 11:20:42 UTC (rev 8085)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlReaderBase.cs	2014-04-29 11:22:48 UTC (rev 8086)
@@ -70,7 +70,16 @@
         public XmlReaderBase(HttpWebResponse resp) 
         {
             _resp = resp;
-            InitCommon(_resp.GetResponseStream());
+            try
+            {
+                InitCommon(_resp.GetResponseStream());
+            }
+            catch
+            {
+                //Clean up the response before bubbling up the exception
+                this.Dispose();
+                throw;
+            }
         }
 
         private void InitCommon(Stream stream)



More information about the mapguide-commits mailing list