فهرست منبع

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