mirror of
https://github.com/gwm17/Specter.git
synced 2024-11-22 10:18:50 -05:00
Fix bug in source detach model which resulted in deadlock.
This commit is contained in:
parent
88173a16cf
commit
7abe92582c
|
@ -100,9 +100,12 @@ namespace Specter {
|
||||||
SPEC_PROFILE_FUNCTION();
|
SPEC_PROFILE_FUNCTION();
|
||||||
SPEC_INFO("Detaching physics data source...");
|
SPEC_INFO("Detaching physics data source...");
|
||||||
|
|
||||||
std::scoped_lock<std::mutex> guard(m_sourceMutex);
|
|
||||||
m_activeFlag = false;
|
m_activeFlag = false;
|
||||||
m_source.reset(nullptr);
|
{
|
||||||
|
std::scoped_lock<std::mutex> guard(m_sourceMutex);
|
||||||
|
m_source.reset(nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_physThread != nullptr && m_physThread->joinable())
|
if (m_physThread != nullptr && m_physThread->joinable())
|
||||||
{
|
{
|
||||||
m_physThread->join();
|
m_physThread->join();
|
||||||
|
|
|
@ -61,14 +61,18 @@ namespace Specter {
|
||||||
|
|
||||||
void RitualClient::Disconnect()
|
void RitualClient::Disconnect()
|
||||||
{
|
{
|
||||||
|
SPEC_INFO("Disconnecting...");
|
||||||
if (IsConnected())
|
if (IsConnected())
|
||||||
{
|
{
|
||||||
asio::post(m_context, [this]() { m_socket.close(); });
|
asio::post(m_context, [this]() { m_socket.close(); });
|
||||||
}
|
}
|
||||||
|
SPEC_INFO("Disconnected...");
|
||||||
|
|
||||||
|
SPEC_INFO("Stopping...");
|
||||||
m_context.stop();
|
m_context.stop();
|
||||||
if (m_ioThread.joinable())
|
if (m_ioThread.joinable())
|
||||||
m_ioThread.join();
|
m_ioThread.join();
|
||||||
|
SPEC_INFO("Stopped...");
|
||||||
}
|
}
|
||||||
|
|
||||||
void RitualClient::ReadSize()
|
void RitualClient::ReadSize()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user