Skip to content

Commit

Permalink
Added using block
Browse files Browse the repository at this point in the history
  • Loading branch information
mansellan committed Jun 17, 2018
1 parent 4428f60 commit b4fee19
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Rubberduck.VBEditor.VBA/SourceCodeHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ public string Export(IVBComponent component)

public void Import(IVBComponent component, string fileName)
{
var components = component.Collection;
components.Remove(component);
components.ImportSourceFile(fileName);
using (var components = component.Collection)
{
components.Remove(component);
components.ImportSourceFile(fileName);
}
}

public string Read(IVBComponent component)
Expand Down

0 comments on commit b4fee19

Please sign in to comment.