diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-07-07 20:50:56 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-07-07 20:50:56 +0300 |
commit | 2cf9f046a6135edd970001a2820c2e8250d763a0 (patch) | |
tree | 62a15ad5bf6ad052eb48b8d412147c17c58a37ab | |
parent | 2f5a5f4151b5912c8b20ea5f29a7ba89c320e46d (diff) |
SL-17545 lodQueryCallback should quit as soon as it is done
-rw-r--r-- | indra/newview/llmodelpreview.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 2920521d31..3bca4fde83 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -842,15 +842,17 @@ void LLModelPreview::clearIncompatible(S32 lod) if (replaced_base_model && !mGenLOD) { // In case base was replaced, we might need to restart generation + + // Check if already started bool subscribe_for_generation = mLodsQuery.empty(); - if (lod == LLModel::LOD_HIGH) - { - mLodsQuery.clear(); - } + + // Remove previously scheduled work + mLodsQuery.clear(); LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance; if (!fmp) return; + // Schedule new work for (S32 i = LLModel::LOD_HIGH; i >= 0; --i) { if (mModel[i].empty()) @@ -867,6 +869,7 @@ void LLModelPreview::clearIncompatible(S32 lod) } } + // Subscribe if we have pending work and not subscribed yet if (!mLodsQuery.empty() && subscribe_for_generation) { doOnIdleRepeating(lodQueryCallback); @@ -3860,7 +3863,7 @@ bool LLModelPreview::lodQueryCallback() } // return false to continue cycle - return false; + return preview->mLodsQuery.empty(); } } // nothing to process |