summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2011-01-07 17:16:28 -0500
committerLoren Shih <seraph@lindenlab.com>2011-01-07 17:16:28 -0500
commit6e671281a26089d7cf947236162afc8013d25ec8 (patch)
tree0f3d4ab19aea4cd541d88b7e0ad5e3001091a052 /indra/newview
parent61e3c95dbf8282dbce5455a7adc466d9c2108a13 (diff)
SH-759 FIXED Various crashes in model floater after you open file picker then cancel
Took out erroneous logic for handling when a file picker is canceled. Reviewed by Davep.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index c0b5b7cfa6..f57d524b46 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -379,7 +379,8 @@ LLFloaterModelPreview::~LLFloaterModelPreview()
{
sInstance = NULL;
- if ( mModelPreview->mModelLoader->mResetJoints )
+ const LLModelLoader *model_loader = mModelPreview->mModelLoader;
+ if (model_loader && model_loader->mResetJoints)
{
gAgentAvatarp->resetJointPositions();
}
@@ -2373,11 +2374,9 @@ void LLModelPreview::loadModel(std::string filename, S32 lod)
LLMutexLock lock(this);
- if (mModelLoader)
- {
- delete mModelLoader;
- mModelLoader = NULL;
- }
+ // This triggers if you bring up the file picker and then hit CANCEL.
+ // Just use the previous model (if any) and ignore that you brought up
+ // the file picker.
if (filename.empty())
{
@@ -2386,12 +2385,17 @@ void LLModelPreview::loadModel(std::string filename, S32 lod)
// this is the initial file picking. Close the whole floater
// if we don't have a base model to show for high LOD.
mFMP->closeFloater(false);
+ mLoading = false;
}
-
- mLoading = false;
return;
}
+ if (mModelLoader)
+ {
+ delete mModelLoader;
+ mModelLoader = NULL;
+ }
+
mLODFile[lod] = filename;
if (lod == LLModel::LOD_HIGH)