diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-06-17 19:45:41 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-06-17 19:57:39 +0300 |
commit | 4043636c59da428e96ac32de7399e438f32a1ad3 (patch) | |
tree | 77ccc1164f91be5488ab0451bce6875215a01e08 /indra/newview/llfloatermodelpreview.cpp | |
parent | 9114d7a5243362e26857d40b2df60f3197521efa (diff) |
SL-13471 Fix for textureLoadedCallback crash
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index bc44e37c5a..e6a3d713e7 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -4374,7 +4374,20 @@ void LLModelPreview::textureLoadedCallback( BOOL final, void* userdata ) { - LLModelPreview* preview = (LLModelPreview*) userdata; + if (!LLFloaterModelPreview::sInstance) + { + return; + } + + // there is a chance that user will manage to open floater second + // time right after closing it, while textures are still loading + // this needs a reliable method to check validity of userdata + LLModelPreview* preview = (LLModelPreview*) userdata; + if (preview != LLFloaterModelPreview::sInstance->mModelPreview) + { + return; + } + preview->refresh(); if(final && preview->mModelLoader) |