소스 검색

Copy global-ish variable to avoid closing over it (tbh that task.run seems unnecessary as SendExceptionInfoToWebhook is already async, but imma assume it has a purpose)

Equbuxu 1 년 전
부모
커밋
0fe207a6be
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/PixiEditor/ViewModels/SubViewModels/Document/AutosaveDocumentViewModel.cs

+ 2 - 1
src/PixiEditor/ViewModels/SubViewModels/Document/AutosaveDocumentViewModel.cs

@@ -256,7 +256,8 @@ internal class AutosaveDocumentViewModel : NotifyableObject
 
             if (savingFailed < 3)
             {
-                Task.Run(() => CrashHelper.SendExceptionInfoToWebhook(new Exception($"Failed to autosave for the {savingFailed}. time due to {result}")));
+                int _savingFailed = savingFailed;
+                Task.Run(() => CrashHelper.SendExceptionInfoToWebhook(new Exception($"Failed to autosave for the {_savingFailed}. time due to {result}")));
             }
         }