diff --git a/include/bounce/common/template/array.h b/include/bounce/common/template/array.h index 9d65ece..a92f2f7 100644 --- a/include/bounce/common/template/array.h +++ b/include/bounce/common/template/array.h @@ -197,6 +197,11 @@ protected: b3Array(const b3Array& other) { + m_localElements = nullptr; + m_capacity = 0; + m_elements = nullptr; + m_count = 0; + Swap(other); } diff --git a/include/bounce/common/template/object_array.h b/include/bounce/common/template/object_array.h index 9360f49..8f4a885 100644 --- a/include/bounce/common/template/object_array.h +++ b/include/bounce/common/template/object_array.h @@ -221,6 +221,11 @@ protected: b3ObjectArray(const b3ObjectArray& other) { + m_localElements = nullptr; + m_capacity = 0; + m_elements = nullptr; + m_count = 0; + Swap(other); } @@ -252,7 +257,7 @@ template class b3StackObjectArray : public b3ObjectArray { public: - b3StackObjectArray() : b3ObjectArray(m_stackElements, N) + b3StackObjectArray() : b3ObjectArray((T*)m_stackElements, N) { } @@ -275,9 +280,7 @@ public: } protected: - //@todo - // u8 m_bytes[N * sizeof(T)]; - T m_stackElements[N]; + u8 m_stackElements[N * sizeof(T)]; }; #endif