Skip to content

Commit

Permalink
Moving the erase from destructors to take place after the actual dest…
Browse files Browse the repository at this point in the history
…ruction but still within the lock (#1541)
  • Loading branch information
VeithMetro committed Mar 8, 2024
1 parent 47972cf commit 68fa80d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Source/com/Communicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ namespace RPC {

if (index != _destructors.end()) {
handler = index->second;
_destructors.erase(index);
}

_adminLock.Unlock();
Expand All @@ -152,6 +151,16 @@ namespace RPC {
handler->Destruct();
handler->Release();
}

_adminLock.Lock();

index = _destructors.find(id);

if (index != _destructors.end()) {
_destructors.erase(index);
}

_adminLock.Unlock();
}
void Destruct(const uint32_t id, Communicator::MonitorableProcess& entry)
{
Expand Down

0 comments on commit 68fa80d

Please sign in to comment.