check status before registering callback

This commit is contained in:
tian-lt 2022-02-17 01:12:17 +08:00
commit c40191fe8b

View file

@ -188,10 +188,9 @@ void CurrencyDataLoader::ResetLoadStatus()
#pragma optimize("", off) // Turn off optimizations to work around DevDiv 393321 #pragma optimize("", off) // Turn off optimizations to work around DevDiv 393321
void CurrencyDataLoader::LoadData() void CurrencyDataLoader::LoadData()
{ {
RegisterForNetworkBehaviorChanges();
if (!LoadFinished()) if (!LoadFinished())
{ {
RegisterForNetworkBehaviorChanges();
create_task([this]() -> task<bool> { create_task([this]() -> task<bool> {
vector<function<future<bool>()>> loadFunctions = { vector<function<future<bool>()>> loadFunctions = {
[this]() { return TryLoadDataFromCacheAsync(); }, [this]() { return TryLoadDataFromCacheAsync(); },