We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5af4c34 commit 50e3b86Copy full SHA for 50e3b86
ADApp/ntndArrayConverterSrc/ntndArrayConverterPvxs.cpp
@@ -335,8 +335,11 @@ void NTNDArrayConverterPvxs::fromValue(NDArray *src) {
335
336
std::string fieldName = m_fieldNameMap[typeid(dataType)];
337
auto arrayType = m_arrayTypeMap[typeid(dataType)];
338
- auto val = pvxs::allocArray(arrayType, arrayInfo.nElements);
339
- memcpy(val.data(), src->pData, arrayInfo.totalBytes);
+ auto val = pvxs::shared_array<dataType>(
+ (dataType*)src->pData,
340
+ // trivial deletor that does nothing when shared_array goes out of scope
341
+ [] (dataType *data) {},
342
+ arrayInfo.nElements);
343
m_value[fieldName] = val.freeze();
344
345
m_value["codec.name"] = src->codec.name; // compression codec
0 commit comments