File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 17
17
using Rubberduck . VBEditor . Application ;
18
18
using Rubberduck . VBEditor . ComManagement ;
19
19
using Rubberduck . VBEditor . Events ;
20
+ using Rubberduck . VBEditor . SafeComWrappers ;
20
21
using Rubberduck . VBEditor . SafeComWrappers . Abstract ;
21
22
22
23
// ReSharper disable LoopCanBeConvertedToQuery
@@ -697,20 +698,19 @@ public void ClearStateCache(string projectId)
697
698
foreach ( var moduleState in _moduleStates . Where ( moduleState => moduleState . Key . ProjectId == projectId ) )
698
699
{
699
700
var qualifiedModuleName = moduleState . Key ;
700
- var component = ProjectsProvider . Component ( moduleState . Key ) ;
701
- if ( component != null )
701
+ if ( qualifiedModuleName . ComponentType == ComponentType . Undefined && qualifiedModuleName . ComponentType == ComponentType . ComComponent )
702
702
{
703
- while ( ! ClearStateCache ( qualifiedModuleName ) )
703
+ if ( _moduleStates . TryRemove ( qualifiedModuleName , out var state ) )
704
704
{
705
- // until Hell freezes over?
705
+ state . Dispose ( ) ;
706
706
}
707
707
}
708
708
else
709
709
{
710
- // store project module name
711
- if ( _moduleStates . TryRemove ( qualifiedModuleName , out var state ) )
710
+ //This should be a user component.
711
+ while ( ! ClearStateCache ( qualifiedModuleName ) )
712
712
{
713
- state . Dispose ( ) ;
713
+ // until Hell freezes over?
714
714
}
715
715
}
716
716
}
You can’t perform that action at this time.
0 commit comments