diff --git a/CefSharp/ResourceHandler.cs b/CefSharp/ResourceHandler.cs index 9117e9b11..0af23a94b 100644 --- a/CefSharp/ResourceHandler.cs +++ b/CefSharp/ResourceHandler.cs @@ -67,6 +67,13 @@ namespace CefSharp /// public ResourceHandlerType Type { get; private set; } + /// + /// When true the Stream will be Disposed when + /// this instance is Disposed. The default value for + /// this property is false. + /// + public bool AutoDisposeStream { get; set; } + /// /// Default Constructor /// @@ -877,7 +884,11 @@ namespace CefSharp /// public virtual void Dispose() { - + if(AutoDisposeStream && Steam != null) + { + Stream.Dispose(); + Stream = null; + } } } }