NickeManarin / ScreenToGif

🎬 ScreenToGif allows you to record a selected area of your screen, edit and save it as a gif or video.
http://www.screentogif.com
Microsoft Public License
23.06k stars 2.15k forks source link

[Bug] A task may only be disposed if it is in a completion state (RanToCompletion, Faulted or Canceled). #1232

Open 3119369616 opened 9 months ago

3119369616 commented 9 months ago

Describe the bug

A task may only be disposed if it is in a completion state (RanToCompletion, Faulted or Canceled).

   at System.Threading.Tasks.Task.Dispose(Boolean disposing)
   at System.Threading.Tasks.Task.Dispose()
   at ScreenToGif.Capture.BaseCapture.DisposeInternal() in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Capture\BaseCapture.cs:line 175
   at ScreenToGif.Capture.BaseCapture.DisposeAsync() in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Capture\BaseCapture.cs:line 184
   at ScreenToGif.Windows.NewRecorder.PrepareCapture(Boolean isNew) in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Windows\NewRecorder.xaml.cs:line 1394
   at ScreenToGif.Windows.NewRecorder.Record() in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Windows\NewRecorder.xaml.cs:line 1033

To Reproduce Steps to reproduce the behavior:

  1. Go into the "recorder".
  2. Press F7.
  3. See error

Expected behavior Record my screen properly.

Screenshots If applicable, add screenshots to help explain your problem. image image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

3119369616 commented 9 months ago

This is the similar issue to #1161.

pawlos commented 9 months ago

The top of the stacktrace is similar also to this issue #1225. I've tried to repro this in some way but never got any issues.