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_INFO("Detaching physics data source...");
|
||||
|
||||
std::scoped_lock<std::mutex> guard(m_sourceMutex);
|
||||
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())
|
||||
{
|
||||
m_physThread->join();
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user