mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Free Vector's memory during move assignment.
This commit is contained in:
parent
a1488a74a1
commit
31e2bc1141
@ -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<T> ) );
|
||||
memset( &src, 0, sizeof( Vector<T> ) );
|
||||
return *this;
|
||||
|
Loading…
Reference in New Issue
Block a user