1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-24 01:54:22 +00:00

IPC: Fix race condition when destroying connections

It was possible to encounter data races when when requesting connection
callbacks on the message thread, but creating/destroying connection
objects on a background thread.

This change ensures that a message will not be processed if the
destination connection is destroyed before the message is delivered.
This commit is contained in:
reuk 2020-10-29 11:39:47 +00:00
parent bef6a91294
commit fb83c45a9d
3 changed files with 100 additions and 42 deletions

View file

@ -73,7 +73,7 @@ void InterprocessConnectionServer::run()
if (clientSocket != nullptr)
if (auto* newConnection = createConnectionObject())
newConnection->initialiseWithSocket (clientSocket.release());
newConnection->initialiseWithSocket (std::move (clientSocket));
}
}