mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 03:32:37 +00:00
ResourceHandler - Add AutoDisposeStream (Stream will be disposed when the ResourceHandler is Disposed)
This commit is contained in:
@@ -67,6 +67,13 @@ namespace CefSharp
|
||||
/// </summary>
|
||||
public ResourceHandlerType Type { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// When true the Stream will be Disposed when
|
||||
/// this instance is Disposed. The default value for
|
||||
/// this property is false.
|
||||
/// </summary>
|
||||
public bool AutoDisposeStream { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Default Constructor
|
||||
/// </summary>
|
||||
@@ -877,7 +884,11 @@ namespace CefSharp
|
||||
/// </summary>
|
||||
public virtual void Dispose()
|
||||
{
|
||||
|
||||
if(AutoDisposeStream && Steam != null)
|
||||
{
|
||||
Stream.Dispose();
|
||||
Stream = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user