Fix not disposing callback in ResourceHandler.Skip (#3978)

This commit is contained in:
chylex
2022-01-21 06:09:35 +01:00
committed by Alex Maitland
parent bedccd2718
commit 1663b19c87
2 changed files with 6 additions and 0 deletions
@@ -151,6 +151,9 @@ namespace CefSharp.Example
bool IResourceHandler.Skip(long bytesToSkip, out long bytesSkipped, IResourceSkipCallback callback)
{
//We don't need the callback, as it's an unmanaged resource we should dispose it (could wrap it in a using statement).
callback.Dispose();
//No Stream or Stream cannot seek then we indicate failure
if (stream == null || !stream.CanSeek)
{
+3
View File
@@ -138,6 +138,9 @@ namespace CefSharp
bool IResourceHandler.Skip(long bytesToSkip, out long bytesSkipped, IResourceSkipCallback callback)
{
//We don't need the callback, as it's an unmanaged resource we should dispose it (could wrap it in a using statement).
callback.Dispose();
//No Stream or Stream cannot seek then we indicate failure
if (Stream == null || !Stream.CanSeek)
{