diff options
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) |