diff --git a/Specter/src/Specter/Physics/PhysicsLayer.cpp b/Specter/src/Specter/Physics/PhysicsLayer.cpp index 7731e0c..aa754b0 100644 --- a/Specter/src/Specter/Physics/PhysicsLayer.cpp +++ b/Specter/src/Specter/Physics/PhysicsLayer.cpp @@ -100,9 +100,12 @@ namespace Specter { SPEC_PROFILE_FUNCTION(); SPEC_INFO("Detaching physics data source..."); - std::scoped_lock guard(m_sourceMutex); m_activeFlag = false; - m_source.reset(nullptr); + { + std::scoped_lock guard(m_sourceMutex); + m_source.reset(nullptr); + } + if (m_physThread != nullptr && m_physThread->joinable()) { m_physThread->join(); diff --git a/Specter/src/Specter/Physics/ritual/RitualClient.cpp b/Specter/src/Specter/Physics/ritual/RitualClient.cpp index 27c0898..e09b665 100644 --- a/Specter/src/Specter/Physics/ritual/RitualClient.cpp +++ b/Specter/src/Specter/Physics/ritual/RitualClient.cpp @@ -61,14 +61,18 @@ namespace Specter { void RitualClient::Disconnect() { + SPEC_INFO("Disconnecting..."); if (IsConnected()) { asio::post(m_context, [this]() { m_socket.close(); }); } + SPEC_INFO("Disconnected..."); + SPEC_INFO("Stopping..."); m_context.stop(); if (m_ioThread.joinable()) m_ioThread.join(); + SPEC_INFO("Stopped..."); } void RitualClient::ReadSize()