mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Don't try to delete empty Vectors.
This commit is contained in:
parent
f2801491bf
commit
9504d6c68f
@ -55,7 +55,7 @@ public:
|
||||
|
||||
tracy_force_inline ~Vector()
|
||||
{
|
||||
if( m_capacity != MaxCapacity() )
|
||||
if( m_capacity != MaxCapacity() && m_ptr )
|
||||
{
|
||||
memUsage.fetch_sub( Capacity() * sizeof( T ), std::memory_order_relaxed );
|
||||
delete[] (T*)m_ptr;
|
||||
@ -65,7 +65,7 @@ public:
|
||||
Vector& operator=( const Vector& ) = delete;
|
||||
tracy_force_inline Vector& operator=( Vector&& src ) noexcept
|
||||
{
|
||||
if( m_capacity != MaxCapacity() )
|
||||
if( m_capacity != MaxCapacity() && m_ptr )
|
||||
{
|
||||
memUsage.fetch_sub( Capacity() * sizeof( T ), std::memory_order_relaxed );
|
||||
delete[] (T*)m_ptr;
|
||||
|
Loading…
Reference in New Issue
Block a user