Prevent double freeing of socket.

This commit is contained in:
Bartosz Taudul 2019-06-09 16:10:21 +02:00
parent b1f8d9fba1
commit 34d89d39a1

View File

@ -1135,6 +1135,7 @@ void Profiler::Worker()
{ {
m_sock->~Socket(); m_sock->~Socket();
tracy_free( m_sock ); tracy_free( m_sock );
m_sock = nullptr;
continue; continue;
} }
@ -1144,6 +1145,7 @@ void Profiler::Worker()
{ {
m_sock->~Socket(); m_sock->~Socket();
tracy_free( m_sock ); tracy_free( m_sock );
m_sock = nullptr;
continue; continue;
} }
@ -1153,6 +1155,7 @@ void Profiler::Worker()
m_sock->Send( &status, sizeof( status ) ); m_sock->Send( &status, sizeof( status ) );
m_sock->~Socket(); m_sock->~Socket();
tracy_free( m_sock ); tracy_free( m_sock );
m_sock = nullptr;
continue; continue;
} }
} }
@ -1234,6 +1237,7 @@ void Profiler::Worker()
m_sock->~Socket(); m_sock->~Socket();
tracy_free( m_sock ); tracy_free( m_sock );
m_sock = nullptr;
#ifndef TRACY_ON_DEMAND #ifndef TRACY_ON_DEMAND
// Client is no longer available here. Accept incoming connections, but reject handshake. // Client is no longer available here. Accept incoming connections, but reject handshake.
@ -1256,6 +1260,7 @@ void Profiler::Worker()
{ {
m_sock->~Socket(); m_sock->~Socket();
tracy_free( m_sock ); tracy_free( m_sock );
m_sock = nullptr;
continue; continue;
} }
@ -1265,6 +1270,7 @@ void Profiler::Worker()
{ {
m_sock->~Socket(); m_sock->~Socket();
tracy_free( m_sock ); tracy_free( m_sock );
m_sock = nullptr;
continue; continue;
} }