diff --git a/server/TracyVector.hpp b/server/TracyVector.hpp index 0502066f..43b16061 100644 --- a/server/TracyVector.hpp +++ b/server/TracyVector.hpp @@ -63,7 +63,11 @@ public: Vector& operator=( const Vector& ) = delete; tracy_force_inline Vector& operator=( Vector&& src ) noexcept { - delete[] (T*)m_ptr; + if( m_capacity != MaxCapacity() ) + { + memUsage.fetch_sub( Capacity() * sizeof( T ), std::memory_order_relaxed ); + delete[] (T*)m_ptr; + } memcpy( this, &src, sizeof( Vector ) ); memset( &src, 0, sizeof( Vector ) ); return *this;