ソースを参照

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

+ 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}")));
             }
         }