Skip to content

Commit d9f6fa1

Browse files
committed
2 parents 0ef9cc2 + 33885b0 commit d9f6fa1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CefSharp.Example/AcceptRangeResourceHandler.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ private bool TryGetRangeHeader(out string contentRange, out int contentLength)
151151

152152
bool IResourceHandler.Skip(long bytesToSkip, out long bytesSkipped, IResourceSkipCallback callback)
153153
{
154+
//We don't need the callback, as it's an unmanaged resource we should dispose it (could wrap it in a using statement).
155+
callback.Dispose();
156+
154157
//No Stream or Stream cannot seek then we indicate failure
155158
if (stream == null || !stream.CanSeek)
156159
{

CefSharp/ResourceHandler.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ bool IResourceHandler.Open(IRequest request, out bool handleRequest, ICallback c
138138

139139
bool IResourceHandler.Skip(long bytesToSkip, out long bytesSkipped, IResourceSkipCallback callback)
140140
{
141+
//We don't need the callback, as it's an unmanaged resource we should dispose it (could wrap it in a using statement).
142+
callback.Dispose();
143+
141144
//No Stream or Stream cannot seek then we indicate failure
142145
if (Stream == null || !Stream.CanSeek)
143146
{

0 commit comments

Comments
 (0)