diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index bc44e37c5ade5b85a498be9fc1cf78cc6ff8c755..e6a3d713e7f6ac1ab308d4a89ee81a1d223c3dc1 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)