From 96e5c7b22e152caf2bf859752def7ebffd2a8844 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Wed, 30 Mar 2016 14:51:54 -0700 Subject: [PATCH] Always clear buffers returned to the memory pool Just a safety measure in case anything evades our 'flattening'. I don't have any evidence that we're failing to clear something, but we want this here as a safeguard. --- .../Internal/MemoryPoolViewBufferScope.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Internal/MemoryPoolViewBufferScope.cs b/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Internal/MemoryPoolViewBufferScope.cs index 10a39dcd5c..9b72316f02 100644 --- a/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Internal/MemoryPoolViewBufferScope.cs +++ b/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Internal/MemoryPoolViewBufferScope.cs @@ -120,7 +120,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal for (var i = 0; i < _leased.Count; i++) { - _viewBufferPool.Return(_leased[i]); + _viewBufferPool.Return(_leased[i], clearArray: true); } _leased.Clear();