From 73226014555b028ae2bdec29b8c7d60e6c20c2df Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 9 Jun 2011 17:07:51 -0600 Subject: partial fix for SH-1804: viewer crashes when uploading "Messerschmitt KR200.dae" eliminated crashing, but still failed to upload it. --- indra/newview/llfloatermodelpreview.cpp | 7 +++++-- indra/newview/llfloatermodelwizard.cpp | 7 +++++-- indra/newview/llmeshrepository.cpp | 5 ++++- indra/newview/llmeshrepository.h | 2 ++ 4 files changed, 16 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 76f3e7fdf4..92ec714c80 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -915,8 +915,11 @@ void LLFloaterModelPreview::onPhysicsStageExecute(LLUICtrl* ctrl, void* data) { LLModel* mdl = sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS][i]; DecompRequest* request = new DecompRequest(stage, mdl); - sInstance->mCurRequest.insert(request); - gMeshRepo.mDecompThread->submitRequest(request); + if(request->isValid()) + { + sInstance->mCurRequest.insert(request); + gMeshRepo.mDecompThread->submitRequest(request); + } } } diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp index 0cd66fbdc2..707c8288df 100644 --- a/indra/newview/llfloatermodelwizard.cpp +++ b/indra/newview/llfloatermodelwizard.cpp @@ -422,8 +422,11 @@ void LLFloaterModelWizard::executePhysicsStage(std::string stage_name) { LLModel* mdl = sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS][i]; DecompRequest* request = new DecompRequest(stage_name, mdl); - sInstance->mCurRequest.insert(request); - gMeshRepo.mDecompThread->submitRequest(request); + if(request->isValid()) + { + sInstance->mCurRequest.insert(request); + gMeshRepo.mDecompThread->submitRequest(request); + } } } } diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 6b8b0f5a00..8e5d132096 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1587,7 +1587,10 @@ void LLMeshUploadThread::doWholeModelUpload() llassert(physics != NULL); DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this); - gMeshRepo.mDecompThread->submitRequest(request); + if(request->isValid()) + { + gMeshRepo.mDecompThread->submitRequest(request); + } } while (!mPhysicsComplete) diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index adf60c7e03..f237c3a60e 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -161,6 +161,8 @@ public: virtual void setStatusMessage(const std::string& msg); + bool isValid() const {return mPositions.size() > 2 && mIndices.size() > 2 ;} + protected: //internal use LLVector3 mBBox[2] ; -- cgit v1.2.3