SL-15628 Crash inside ~LLModelInstanceBase

More explicit cleanup in hopes of narrowing down which of the models
failed
master
Andrey Kleshchev 2023-12-14 22:51:18 +02:00 committed by akleshchev
parent 009cd9adcc
commit 8ea1f4a3fc
5 changed files with 27 additions and 3 deletions

View File

@ -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;

View File

@ -67,6 +67,7 @@ LLModel::~LLModel()
{
LLConvexDecomposition::getInstance()->deleteDecomposition(mDecompID);
}
mPhysics.mMesh.clear();
}
//static

View File

@ -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();
};

View File

@ -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()

View File

@ -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;