Properly dispose the file stream

This commit is contained in:
_aLfa_ 2014-09-15 20:06:33 +02:00
parent 2fd35789ea
commit 5be9671735

View File

@ -22,9 +22,10 @@ namespace Nikse.SubtitleEdit.Logic.VobSub
public void Open(string fileName)
{
var fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
Open(fs);
fs.Close();
using (var fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
Open(fs);
}
}
/// <summary>