closes https://github.com/assimp/assimp/issues/3190 : fix leak.
parent
8675bb0912
commit
5c9a08e375
|
@ -313,8 +313,13 @@ struct aiMetadata {
|
||||||
|
|
||||||
// Set metadata type
|
// Set metadata type
|
||||||
mValues[index].mType = GetAiType(value);
|
mValues[index].mType = GetAiType(value);
|
||||||
|
|
||||||
// Copy the given value to the dynamic storage
|
// Copy the given value to the dynamic storage
|
||||||
mValues[index].mData = new T(value);
|
if (nullptr != mValues[index].mData) {
|
||||||
|
::memcpy(mValues[index].mData, &value, sizeof(T));
|
||||||
|
} else {
|
||||||
|
mValues[index].mData = new T(value);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue