Skip to content

Commit 8eb8b84

Browse files
committed
IResponseFilter now implements IDisposable
Call delete in CefResponseFilterAdapter destructor
1 parent de3afe7 commit 8eb8b84

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

CefSharp.Core/Internals/CefResponseFilterAdapter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace CefSharp
2828

2929
~CefResponseFilterAdapter()
3030
{
31+
delete _filter;
3132
_filter = nullptr;
3233
}
3334

CefSharp.Example/Filters/AppendResponseFilter.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,10 @@ FilterStatus IResponseFilter.Filter(Stream dataIn, out long dataInRead, Stream d
8383

8484
return FilterStatus.Done;
8585
}
86+
87+
public void Dispose()
88+
{
89+
90+
}
8691
}
8792
}

CefSharp.Example/Filters/FindReplaceResponseFilter.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,5 +181,10 @@ private void WriteSingleByte(byte data, Stream dataOut, ref long dataOutWritten)
181181
overflow.Add(data);
182182
}
183183
}
184+
185+
public void Dispose()
186+
{
187+
188+
}
184189
}
185190
}

CefSharp.Example/Filters/PassThruResponseFilter.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,10 @@ FilterStatus IResponseFilter.Filter(Stream dataIn, out long dataInRead, Stream d
3131

3232
return FilterStatus.Done;
3333
}
34+
35+
public void Dispose()
36+
{
37+
38+
}
3439
}
3540
}

CefSharp/IResponseFilter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
//
33
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
44

5+
using System;
56
using System.IO;
67

78
namespace CefSharp
89
{
9-
public interface IResponseFilter
10+
public interface IResponseFilter : IDisposable
1011
{
1112
/// <summary>
1213
/// Initialize the response filter. Will only be called a single time.

0 commit comments

Comments
 (0)