fixed some concurrency issues

This commit is contained in:
fourtf
2020-08-22 11:45:18 +02:00
parent 0b0f1c9c5c
commit 83b6fad8e6
4 changed files with 17 additions and 6 deletions
+8 -4
View File
@@ -289,10 +289,14 @@ void Application::initPubsub()
QString channelId;
if (rj::getSafe(data, "channel_id", channelId))
{
const auto &chan =
this->twitch.server->getChannelOrEmptyByID(channelId);
auto channel = dynamic_cast<TwitchChannel *>(chan.get());
channel->addChannelPointReward(ChannelPointReward(data));
auto chan = this->twitch.server->getChannelOrEmptyByID(channelId);
auto reward = ChannelPointReward(data);
postToThread([chan, reward] {
auto channel = dynamic_cast<TwitchChannel *>(chan.get());
channel->addChannelPointReward(reward);
});
}
else
{