From fd5e81d37dd3424041afd5c94e1b442f77015700 Mon Sep 17 00:00:00 2001 From: Alex Maitland Date: Tue, 9 Aug 2022 11:23:59 +1000 Subject: [PATCH] Core - ResourceHandler.ForErrorMessage auto dispose of Stream Dispose of stream when done, cannot reuse ResourceHandler. Follow up to https://github.com/cefsharp/CefSharp/pull/4119 --- CefSharp/ResourceHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CefSharp/ResourceHandler.cs b/CefSharp/ResourceHandler.cs index d5fa8dbe3b..f17890d316 100644 --- a/CefSharp/ResourceHandler.cs +++ b/CefSharp/ResourceHandler.cs @@ -335,7 +335,7 @@ public static IResourceHandler ForErrorMessage(string errorMessage, HttpStatusCo { var stream = GetMemoryStream(errorMessage, Encoding.UTF8); - var resourceHandler = FromStream(stream); + var resourceHandler = FromStream(stream, autoDisposeStream: true); resourceHandler.StatusCode = (int)statusCode; return resourceHandler;