Fix exception resource leak CID 18146

This commit is contained in:
_aLfa_ 2014-11-22 11:40:00 +01:00
parent ba91507b2c
commit 4e05e7f503

View File

@ -11930,26 +11930,27 @@ namespace Nikse.SubtitleEdit.Forms
private void toolStripMenuItemPointSync_Click(object sender, EventArgs e) private void toolStripMenuItemPointSync_Click(object sender, EventArgs e)
{ {
SyncPointsSync pointSync = new SyncPointsSync(); using (var pointSync = new SyncPointsSync())
pointSync.Initialize(_subtitle, _fileName, _videoFileName, _videoAudioTrackNumber);
_formPositionsAndSizes.SetPositionAndSize(pointSync);
mediaPlayer.Pause();
if (pointSync.ShowDialog(this) == DialogResult.OK)
{ {
_subtitleListViewIndex = -1; pointSync.Initialize(_subtitle, _fileName, _videoFileName, _videoAudioTrackNumber);
MakeHistoryForUndo(_language.BeforePointSynchronization); _formPositionsAndSizes.SetPositionAndSize(pointSync);
_subtitle.Paragraphs.Clear(); mediaPlayer.Pause();
foreach (Paragraph p in pointSync.FixedSubtitle.Paragraphs) if (pointSync.ShowDialog(this) == DialogResult.OK)
_subtitle.Paragraphs.Add(p); {
_subtitle.CalculateFrameNumbersFromTimeCodesNoCheck(CurrentFrameRate); _subtitleListViewIndex = -1;
ShowStatus(_language.PointSynchronizationDone); MakeHistoryForUndo(_language.BeforePointSynchronization);
ShowSource(); _subtitle.Paragraphs.Clear();
SubtitleListview1.Fill(_subtitle, _subtitleAlternate); foreach (Paragraph p in pointSync.FixedSubtitle.Paragraphs)
_subtitle.Paragraphs.Add(p);
_subtitle.CalculateFrameNumbersFromTimeCodesNoCheck(CurrentFrameRate);
ShowStatus(_language.PointSynchronizationDone);
ShowSource();
SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
}
Activate();
_videoFileName = pointSync.VideoFileName;
_formPositionsAndSizes.SavePositionAndSize(pointSync);
} }
Activate();
_videoFileName = pointSync.VideoFileName;
_formPositionsAndSizes.SavePositionAndSize(pointSync);
pointSync.Dispose();
} }
private void pointSyncViaOtherSubtitleToolStripMenuItem_Click(object sender, EventArgs e) private void pointSyncViaOtherSubtitleToolStripMenuItem_Click(object sender, EventArgs e)