mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Fix crash when a GC client disconnects
The client thread can't just delete its own thread object from connections, it has to detach it.
This commit is contained in:
parent
4d014221d4
commit
e0936ae38f
1 changed files with 4 additions and 1 deletions
|
@ -536,7 +536,10 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
|
|||
auto fdClient_ = fdClient.get();
|
||||
std::thread clientThread([&, fdClient = std::move(fdClient)]() {
|
||||
Finally cleanup([&]() {
|
||||
connections.lock()->erase(fdClient.get());
|
||||
auto conn(connections.lock());
|
||||
auto i = conn->find(fdClient.get());
|
||||
i->second.detach();
|
||||
conn->erase(i);
|
||||
});
|
||||
|
||||
while (true) {
|
||||
|
|
Loading…
Reference in a new issue