Skip to content

Commit 23cb6e4

Browse files
committed
Minor fixes
1 parent 37433fe commit 23cb6e4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: Files/Helpers/AsyncManualResetEvent.cs

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public Task<bool> WaitAsync(int milliseconds, CancellationToken cancellationToke
3333
cancellationToken.Register(
3434
s => ((TaskCompletionSource<bool>)s).TrySetCanceled(), tcs);
3535

36-
3736
return Task.WhenAny(m_tcs.Task, Delay(milliseconds)).Result;
3837
}
3938

Diff for: Files/ViewModels/ItemViewModel.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -909,11 +909,13 @@ public async Task LoadExtendedItemProperties(ListedItem item, uint thumbnailSize
909909
item.ItemPropertiesInitialized = true;
910910
itemLoadQueue[item.ItemPath] = false;
911911

912+
var cts = loadPropsCTS;
913+
912914
try
913915
{
914916
await Task.Run(async () =>
915917
{
916-
await loadPropsEvent.WaitAsync(loadPropsCTS.Token);
918+
await loadPropsEvent.WaitAsync(cts.Token);
917919

918920
if (itemLoadQueue.TryGetValue(item.ItemPath, out var canceled) && canceled)
919921
{
@@ -1039,7 +1041,7 @@ await FilesystemTasks.Wrap(() => CoreApplication.MainView.DispatcherQueue.Enqueu
10391041
}));
10401042
}
10411043
}
1042-
}, loadPropsCTS.Token);
1044+
}, cts.Token);
10431045
}
10441046
catch (OperationCanceledException)
10451047
{

0 commit comments

Comments
 (0)