Skip to content

Commit 8437380

Browse files
committed
Fix ownership of the content of Variant
Copy and move of Variants holding Array2D, LabeledArray or string array values copied the storage byte by byte, so copies shared the same heap buffers, and the destructor never destroyed these objects, leaking them. Assignments never released the previous content, move assignment of strings and arrays duplicated the buffer and dropped the original one, and move assignment of string arrays corrupted the source vector.
1 parent 718d1cf commit 8437380

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎Framework/Core/include/Framework/Variant.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ class Variant
403403
*this = Variant(value, size);
404404
}
405405

406+
/// FIXME: set for vector of strings is not used anywhere, why?
406407
template <typename T>
407408
void set(std::vector<T>& values)
408409
requires(std::is_pod_v<T> || std::is_same_v<T, std::string>)

0 commit comments

Comments
 (0)