Skip to content

Commit

Permalink
Plug leaks in code explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
bclothier committed Oct 24, 2018
1 parent 9c9fbc3 commit f1c9125
Showing 1 changed file with 12 additions and 2 deletions.
Expand Up @@ -68,8 +68,9 @@ public CodeExplorerComponentViewModel(CodeExplorerItemViewModel parent, Declarat
var component = _projectsProvider.Component(qualifiedModuleName);
string parenthesizedName;
using (var properties = component.Properties)
using (var nameProperty = properties["Name"])
{
parenthesizedName = properties["Name"].Value.ToString() ?? string.Empty;
parenthesizedName = nameProperty.Value.ToString() ?? string.Empty;
}

if (ContainsBuiltinDocumentPropertiesProperty())
Expand Down Expand Up @@ -113,7 +114,16 @@ private bool ContainsBuiltinDocumentPropertiesProperty()
var component = _projectsProvider.Component(Declaration.QualifiedName.QualifiedModuleName);
using (var properties = component.Properties)
{
return properties.Any(item => item.Name == "BuiltinDocumentProperties");
foreach (var property in properties)
using(property)
{
if (property.Name == "BuiltinDocumentProperties")
{
return true;
}
}

return false;
}
}

Expand Down

0 comments on commit f1c9125

Please sign in to comment.