scenecombiner: fix leak.
parent
b9c597d055
commit
c6131ce38a
|
@ -979,7 +979,7 @@ void GetArrayCopy(Type*& dest, ai_uint num ) {
|
||||||
|
|
||||||
dest = new Type[num];
|
dest = new Type[num];
|
||||||
::memcpy(dest, old, sizeof(Type) * num);
|
::memcpy(dest, old, sizeof(Type) * num);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void SceneCombiner::CopySceneFlat(aiScene** _dest,const aiScene* src) {
|
void SceneCombiner::CopySceneFlat(aiScene** _dest,const aiScene* src) {
|
||||||
|
@ -1269,9 +1269,6 @@ void SceneCombiner::Copy(aiBone** _dest, const aiBone* src) {
|
||||||
|
|
||||||
// get a flat copy
|
// get a flat copy
|
||||||
*dest = *src;
|
*dest = *src;
|
||||||
|
|
||||||
// and reallocate all arrays
|
|
||||||
GetArrayCopy( dest->mWeights, dest->mNumWeights );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -308,7 +308,10 @@ struct aiBone {
|
||||||
|
|
||||||
//! Copy constructor
|
//! Copy constructor
|
||||||
aiBone(const aiBone &other) :
|
aiBone(const aiBone &other) :
|
||||||
mName(other.mName), mNumWeights(other.mNumWeights), mWeights(nullptr), mOffsetMatrix(other.mOffsetMatrix) {
|
mName(other.mName),
|
||||||
|
mNumWeights(other.mNumWeights),
|
||||||
|
mWeights(nullptr),
|
||||||
|
mOffsetMatrix(other.mOffsetMatrix) {
|
||||||
if (other.mWeights && other.mNumWeights) {
|
if (other.mWeights && other.mNumWeights) {
|
||||||
mWeights = new aiVertexWeight[mNumWeights];
|
mWeights = new aiVertexWeight[mNumWeights];
|
||||||
::memcpy(mWeights, other.mWeights, mNumWeights * sizeof(aiVertexWeight));
|
::memcpy(mWeights, other.mWeights, mNumWeights * sizeof(aiVertexWeight));
|
||||||
|
|
Loading…
Reference in New Issue