diff options
| author | Dave Parks <davep@lindenlab.com> | 2010-10-15 16:33:22 -0500 |
|---|---|---|
| committer | Dave Parks <davep@lindenlab.com> | 2010-10-15 16:33:22 -0500 |
| commit | 997d66d348b3c6a19ecd2f5b092f68f645712eb1 (patch) | |
| tree | c5d13f10ab27b32b0746290b8dbf3df45c38c673 /indra/newview/llmeshrepository.cpp | |
| parent | 70a98095c05df10eda3289988b6bdb21dbfaa0f3 (diff) | |
Fix for various crashes on exit and leaks when using convex decomposition.
Make rendering of convex hullified prims work in physics shape display.
Reviewed by Falcon.
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
| -rw-r--r-- | indra/newview/llmeshrepository.cpp | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index e97fd52c7e..3c51781dfa 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -460,7 +460,7 @@ LLMeshRepoThread::~LLMeshRepoThread() void LLMeshRepoThread::run() { mCurlRequest = new LLCurlRequest(); - LLCDResult res = LLConvexDecomposition::initThread(); + LLCDResult res = LLConvexDecomposition::initThread(); if (res != LLCD_OK) { llwarns << "convex decomposition unable to be loaded" << llendl; @@ -1835,6 +1835,8 @@ void LLMeshRepository::init() { mMeshMutex = new LLMutex(NULL); + LLConvexDecomposition::getInstance()->initSystem(); + mDecompThread = new LLPhysicsDecomp(); mDecompThread->start(); @@ -1843,6 +1845,8 @@ void LLMeshRepository::init() apr_sleep(100); } + + mThread = new LLMeshRepoThread(); mThread->start(); } @@ -1870,6 +1874,8 @@ void LLMeshRepository::shutdown() delete mDecompThread; mDecompThread = NULL; } + + LLConvexDecomposition::quitSystem(); } @@ -2807,8 +2813,12 @@ void LLPhysicsDecomp::doDecomposition() //build parameter map std::map<std::string, const LLCDParam*> param_map; - const LLCDParam* params; - S32 param_count = LLConvexDecomposition::getInstance()->getParameters(¶ms); + static const LLCDParam* params = NULL; + static S32 param_count = 0; + if (!params) + { + param_count = LLConvexDecomposition::getInstance()->getParameters(¶ms); + } for (S32 i = 0; i < param_count; ++i) { @@ -2965,8 +2975,13 @@ void LLPhysicsDecomp::doDecompositionSingleHull() //set all parameters to default std::map<std::string, const LLCDParam*> param_map; - const LLCDParam* params; - S32 param_count = LLConvexDecomposition::getInstance()->getParameters(¶ms); + static const LLCDParam* params = NULL; + static S32 param_count = 0; + + if (!params) + { + param_count = LLConvexDecomposition::getInstance()->getParameters(¶ms); + } LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance(); @@ -3048,13 +3063,18 @@ void LLPhysicsDecomp::doDecompositionSingleHull() void LLPhysicsDecomp::run() { - LLConvexDecomposition::initSystem(); + LLConvexDecomposition::getInstance()->initThread(); mInited = true; LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance(); - const LLCDStageData* stages; - S32 num_stages = decomp->getStages(&stages); + static const LLCDStageData* stages = NULL; + static S32 num_stages = 0; + + if (!stages) + { + num_stages = decomp->getStages(&stages); + } for (S32 i = 0; i < num_stages; i++) { @@ -3083,8 +3103,8 @@ void LLPhysicsDecomp::run() } } - LLConvexDecomposition::quitSystem(); - + LLConvexDecomposition::getInstance()->quitThread(); + //delete mSignal; delete mMutex; mSignal = NULL; |
