diff --git a/CefSharp.Example/AcceptRangeResourceHandler.cs b/CefSharp.Example/AcceptRangeResourceHandler.cs index 27f916272a..4f48712935 100644 --- a/CefSharp.Example/AcceptRangeResourceHandler.cs +++ b/CefSharp.Example/AcceptRangeResourceHandler.cs @@ -151,6 +151,9 @@ private bool TryGetRangeHeader(out string contentRange, out int contentLength) 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) { diff --git a/CefSharp/ResourceHandler.cs b/CefSharp/ResourceHandler.cs index b15091eb47..d5fa8dbe3b 100644 --- a/CefSharp/ResourceHandler.cs +++ b/CefSharp/ResourceHandler.cs @@ -138,6 +138,9 @@ bool IResourceHandler.Open(IRequest request, out bool handleRequest, ICallback c 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) {