mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-01 04:30:49 +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 screenshot = TaskHelpers.GetScreenshot(taskSettings);
|
||||||
screenshot.CaptureCursor = taskSettings.CaptureSettings.ScreenRecordShowCursor;
|
screenshot.CaptureCursor = taskSettings.CaptureSettings.ScreenRecordShowCursor;
|
||||||
|
|
||||||
|
screenRecorder?.Dispose();
|
||||||
screenRecorder = new ScreenRecorder(ScreenRecordOutput.FFmpeg, options, screenshot, captureRectangle);
|
screenRecorder = new ScreenRecorder(ScreenRecordOutput.FFmpeg, options, screenshot, captureRectangle);
|
||||||
screenRecorder.RecordingStarted += ScreenRecorder_RecordingStarted;
|
screenRecorder.RecordingStarted += ScreenRecorder_RecordingStarted;
|
||||||
screenRecorder.EncodingProgressChanged += ScreenRecorder_EncodingProgressChanged;
|
screenRecorder.EncodingProgressChanged += ScreenRecorder_EncodingProgressChanged;
|
||||||
|
@ -313,12 +314,15 @@ private static void StartRecording(ScreenRecordOutput outputType, TaskSettings t
|
||||||
{
|
{
|
||||||
screenRecorder.Dispose();
|
screenRecorder.Dispose();
|
||||||
screenRecorder = null;
|
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(() =>
|
}).ContinueInCurrentContext(() =>
|
||||||
{
|
{
|
||||||
if (!abortRequested && !string.IsNullOrEmpty(path) && File.Exists(path) && TaskHelpers.ShowAfterCaptureForm(taskSettings, out string customFileName, null, path))
|
if (!abortRequested && !string.IsNullOrEmpty(path) && File.Exists(path) && TaskHelpers.ShowAfterCaptureForm(taskSettings, out string customFileName, null, path))
|
||||||
|
|
Loading…
Reference in a new issue