Skip to content

Commit 111451a

Browse files
committed
Dispose file after creation to allow process release (avoid process being used- issue when renaming)
1 parent 243e173 commit 111451a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SQLScriptsExplorer.Addin/Controls/FileExplorerTreeView.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ private void mnuNewFile_Click(object sender, RoutedEventArgs e)
334334

335335
if (!File.Exists(newFilePath))
336336
{
337-
File.Create(newFilePath);
337+
using (File.Create(newFilePath)) { }
338338

339339
var newTreeNode = new TreeNode(newFileName, newFilePath, TreeNodeType.File);
340340
newTreeNode.Parent = currentTreeNode;

0 commit comments

Comments
 (0)