File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public interface IParserStateEvents
38
38
[ ComDefaultInterface ( typeof ( IParserState ) ) ]
39
39
[ ComSourceInterfaces ( typeof ( IParserStateEvents ) ) ]
40
40
[ EditorBrowsable ( EditorBrowsableState . Always ) ]
41
- public class ParserState : IParserState , IDisposable
41
+ public sealed class ParserState : IParserState , IDisposable
42
42
{
43
43
private const string ClassId = "28754D11-10CC-45FD-9F6A-525A65412B7A" ;
44
44
private const string ProgId = "Rubberduck.ParserState" ;
@@ -133,16 +133,10 @@ public Declaration[] UserDeclarations
133
133
get { return _userDeclarations ; }
134
134
}
135
135
136
- private bool _dispose = true ;
136
+ private bool _disposed ;
137
137
public void Dispose ( )
138
138
{
139
- Dispose ( _dispose ) ;
140
- _dispose = false ;
141
- }
142
-
143
- protected virtual void Dispose ( bool disposing )
144
- {
145
- if ( ! disposing )
139
+ if ( _disposed )
146
140
{
147
141
return ;
148
142
}
@@ -151,6 +145,8 @@ protected virtual void Dispose(bool disposing)
151
145
{
152
146
_state . StateChanged -= _state_StateChanged ;
153
147
}
148
+
149
+ _disposed = true ;
154
150
}
155
151
}
156
152
}
You can’t perform that action at this time.
0 commit comments