File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 1
1
<Project >
2
2
<PropertyGroup >
3
- <Version >3.0.60009 </Version >
4
- <FileVersion >3.0.60009 </FileVersion >
3
+ <Version >3.0.60010 </Version >
4
+ <FileVersion >3.0.60010 </FileVersion >
5
5
<LangVersion >latest</LangVersion >
6
6
<DebugType >embedded</DebugType >
7
7
Original file line number Diff line number Diff line change @@ -143,7 +143,10 @@ public int MaxSkipLevels
143
143
144
144
public void Dispose ( )
145
145
{
146
- if ( isDisposed ) return ;
146
+ if ( isDisposed )
147
+ return ;
148
+
149
+ GC . SuppressFinalize ( this ) ;
147
150
148
151
// Move to protected method if class becomes unsealed
149
152
if ( origEnum != null )
@@ -156,6 +159,18 @@ public void Dispose()
156
159
157
160
isDisposed = true ;
158
161
}
162
+
163
+ ~ TermInfosReader ( )
164
+ {
165
+ // each TermInfosReader holds a cache (ArrayHolder) which is created upon creation of the TermInfosReader instance.
166
+ // in the past we created a new ArrayHolder when creating a new TermInfosReader instance.
167
+ // if it wasn't disposed, nothing happened since we have a finalizer for the ArrayHolder.
168
+ // we changed the implementation and now this cache is shared between different instances of TermInfosReader.
169
+ // when TermInfosReader isn't disposed we are still holding a reference to the ArrayHolder.
170
+
171
+ // releasing the reference for the cached ArrayHolder will match the previous behaviour.
172
+ _termsIndexCache ? . ReleaseRef ( ) ;
173
+ }
159
174
160
175
/// <summary>Returns the number of term/value pairs in the set. </summary>
161
176
internal long Size ( )
You can’t perform that action at this time.
0 commit comments