diff options
author | Mikkel Krautz <mikkel@krautz.dk> | 2016-05-15 17:02:00 +0300 |
---|---|---|
committer | Mikkel Krautz <mikkel@krautz.dk> | 2016-06-24 01:03:11 +0300 |
commit | f260bd19133086b993a4a0cd027293153b4a15f0 (patch) | |
tree | 5f754783b1960d4de696d40fae641899e3675b8b /src/murmur/RPC.cpp | |
parent | 5c0c8d8e58958c388af76aded527b8a9e6d2ce11 (diff) |
Implement correct write locking for addChannel/removeChannel/link/unlink.
Diffstat (limited to 'src/murmur/RPC.cpp')
-rw-r--r-- | src/murmur/RPC.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/murmur/RPC.cpp b/src/murmur/RPC.cpp index 8be9a3df1..9904b2a5e 100644 --- a/src/murmur/RPC.cpp +++ b/src/murmur/RPC.cpp @@ -127,8 +127,13 @@ bool Server::setChannelStateGRPC(const MumbleProto::ChannelState &cs, QString &e err = QLatin1String("channel cannot be nested in the given parent"); return false; } - channel->cParent->removeChannel(channel); - parent->addChannel(channel); + + { + QWriteLocker wl(&qrwlVoiceThread); + channel->cParent->removeChannel(channel); + parent->addChannel(channel); + } + mpcs.set_parent(parent->iId); changed = true; @@ -229,8 +234,11 @@ bool Server::setChannelState(Channel *cChannel, Channel *cParent, const QString return false; } - cChannel->cParent->removeChannel(cChannel); - cParent->addChannel(cChannel); + { + QWriteLocker wl(&qrwlVoiceThread); + cChannel->cParent->removeChannel(cChannel); + cParent->addChannel(cChannel); + } mpcs.set_parent(cParent->iId); |