diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-12-14 22:51:18 +0200 |
---|---|---|
committer | akleshchev <117672381+akleshchev@users.noreply.github.com> | 2023-12-15 03:51:36 +0200 |
commit | 8ea1f4a3fc77145cb60a7b8182e0da9c0e43ed69 (patch) | |
tree | 3a2640d7532d80c9118ecab86a0cb5c7396c7418 /indra | |
parent | 009cd9adccd117357fa4054c523218a0e990bb80 (diff) |
SL-15628 Crash inside ~LLModelInstanceBase
More explicit cleanup in hopes of narrowing down which of the models
failed
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llmath/llvolume.h | 2 | ||||
-rw-r--r-- | indra/llprimitive/llmodel.cpp | 1 | ||||
-rw-r--r-- | indra/llprimitive/llmodel.h | 16 | ||||
-rw-r--r-- | indra/newview/llmodelpreview.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llmodelpreview.h | 1 |
5 files changed, 27 insertions, 3 deletions
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index afed98ff36..71878b8cb6 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -1000,7 +1000,7 @@ class LLVolume : public LLRefCount friend class LLVolumeLODGroup; protected: - ~LLVolume(); // use unref + virtual ~LLVolume(); // use unref public: typedef std::vector<LLVolumeFace> face_list_t; diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index ee493968de..68a7f29378 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -67,6 +67,7 @@ LLModel::~LLModel() { LLConvexDecomposition::getInstance()->deleteDecomposition(mDecompID); } + mPhysics.mMesh.clear(); } //static diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 4505d6b3b9..040257e00e 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -106,6 +106,8 @@ public: std::vector<LLVector3> mPositions; std::vector<LLVector3> mNormals; + ~PhysicsMesh() {} + void clear() { mPositions.clear(); @@ -131,6 +133,7 @@ public: public: Decomposition() { } Decomposition(LLSD& data); + ~Decomposition() { } void fromLLSD(LLSD& data); LLSD asLLSD() const; bool hasHullList() const; @@ -365,7 +368,7 @@ class LLModelInstanceBase { public: LLPointer<LLModel> mModel; - LLPointer<LLModel> mLOD[5]; + LLPointer<LLModel> mLOD[LLModel::NUM_LODS]; LLUUID mMeshID; LLMatrix4 mTransform; @@ -380,6 +383,15 @@ public: : mModel(NULL) { } + + virtual ~LLModelInstanceBase() + { + mModel = NULL; + for (int j = 0; j < LLModel::NUM_LODS; ++j) + { + mLOD[j] = NULL; + } + }; }; typedef std::vector<LLModelInstanceBase> model_instance_list; @@ -399,6 +411,8 @@ public: LLModelInstance(LLSD& data); + ~LLModelInstance() {} + LLSD asLLSD(); }; diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index ccae1030f1..ad22e84c6e 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -220,6 +220,16 @@ LLModelPreview::~LLModelPreview() mPreviewAvatar->markDead(); mPreviewAvatar = NULL; } + + mUploadData.clear(); + mTextureSet.clear(); + + for (U32 i = 0; i < LLModel::NUM_LODS; i++) + { + clearModel(i); + } + mBaseModel.clear(); + mBaseScene.clear(); } void LLModelPreview::updateDimentionsAndOffsets() diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h index df7320768c..d4d5d087bd 100644 --- a/indra/newview/llmodelpreview.h +++ b/indra/newview/llmodelpreview.h @@ -310,7 +310,6 @@ protected: vv_LLVolumeFace_t mBaseModelFacesCopy; U32 mGroup; - std::map<LLPointer<LLModel>, U32> mObject; // Amount of triangles in original(base) model U32 mMaxTriangleLimit; |