diff --git a/src/Application.cpp b/src/Application.cpp index 0d641c83..357e3993 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(