summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llmath/llvolume.h2
-rw-r--r--indra/llprimitive/llmodel.cpp1
-rw-r--r--indra/llprimitive/llmodel.h16
-rw-r--r--indra/newview/llmodelpreview.cpp10
-rw-r--r--indra/newview/llmodelpreview.h1
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;