From 4841411351c606b92147f1bc511cf8e8c47e32e8 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Fri, 30 Sep 2011 01:20:29 -0400 Subject: [PATCH] Plug an unmanaged memory leak If Flush() was called with final_flush set to true, we were leaking the unmanaged memory in the output stream (if allocated). It was "only" an AS leak. Thanks to Kumpera for the help debugging this. --- mcs/class/System.Web/System.Web/HttpResponse.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mcs/class/System.Web/System.Web/HttpResponse.cs b/mcs/class/System.Web/System.Web/HttpResponse.cs index 2e633d9666b..6a310ecc874 100644 --- a/mcs/class/System.Web/System.Web/HttpResponse.cs +++ b/mcs/class/System.Web/System.Web/HttpResponse.cs @@ -1365,10 +1365,11 @@ namespace System.Web internal void ReleaseResources () { + if (output_stream != null) + output_stream.ReleaseResources (true); if (completed) return; - output_stream.ReleaseResources (true); Close (); completed = true; } -- 2.25.1