mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-28 11:10:23 +12:00
Make sure temp files deleted
This commit is contained in:
parent
0b2a4a7411
commit
804f1beab2
|
@ -262,6 +262,7 @@ private static void StartRecording(ScreenRecordOutput outputType, TaskSettings t
|
|||
Screenshot screenshot = TaskHelpers.GetScreenshot(taskSettings);
|
||||
screenshot.CaptureCursor = taskSettings.CaptureSettings.ScreenRecordShowCursor;
|
||||
|
||||
screenRecorder?.Dispose();
|
||||
screenRecorder = new ScreenRecorder(ScreenRecordOutput.FFmpeg, options, screenshot, captureRectangle);
|
||||
screenRecorder.RecordingStarted += ScreenRecorder_RecordingStarted;
|
||||
screenRecorder.EncodingProgressChanged += ScreenRecorder_EncodingProgressChanged;
|
||||
|
@ -313,12 +314,15 @@ private static void StartRecording(ScreenRecordOutput outputType, TaskSettings t
|
|||
{
|
||||
screenRecorder.Dispose();
|
||||
screenRecorder = null;
|
||||
|
||||
if (abortRequested && !string.IsNullOrEmpty(path) && File.Exists(path))
|
||||
{
|
||||
File.Delete(path);
|
||||
}
|
||||
}
|
||||
|
||||
if (abortRequested)
|
||||
{
|
||||
FileHelpers.DeleteFile(path);
|
||||
}
|
||||
|
||||
FileHelpers.DeleteFile(concatPath);
|
||||
FileHelpers.DeleteFile(tempPath);
|
||||
}).ContinueInCurrentContext(() =>
|
||||
{
|
||||
if (!abortRequested && !string.IsNullOrEmpty(path) && File.Exists(path) && TaskHelpers.ShowAfterCaptureForm(taskSettings, out string customFileName, null, path))
|
||||
|
|
Loading…
Reference in a new issue