Await async delegates fully in DispatcherHelper

Ensure that async functions invoked via dispatcher are awaited until completion, not just until scheduled, by using double await on InvokeAsync. This prevents premature continuation when the delegate itself is asynchronous.
This commit is contained in:
Jack251970 2026-03-10 12:00:28 +08:00
parent 7c55986b24
commit fc147c3377

View file

@ -95,7 +95,7 @@ public static class DispatcherHelper
}
else
{
await dispatcher.InvokeAsync(func, priority);
await await dispatcher.InvokeAsync(func, priority);
}
}
}