From 0b9f62188c15cb17a2152b7bcf73d8bf4c566fc2 Mon Sep 17 00:00:00 2001 From: nerix Date: Sat, 9 Apr 2022 13:58:18 +0200 Subject: [PATCH] fix: build user timeout/ban message in GUI thread (#3665) Co-authored-by: pajlada --- src/Application.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index 0d641c83f..357e39932 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -269,11 +269,10 @@ void Application::initPubsub() return; } - MessageBuilder msg(action); - msg->flags.set(MessageFlag::PubSub); - - postToThread([chan, msg = msg.release()] { - chan->addOrReplaceTimeout(msg); + postToThread([chan, action] { + MessageBuilder msg(action); + msg->flags.set(MessageFlag::PubSub); + chan->addOrReplaceTimeout(msg.release()); }); }); this->twitch->pubsub->signals_.moderation.messageDeleted.connect(