fix: only remove logging channels if we added them (#5828)

This commit is contained in:
nerix
2025-01-19 14:16:10 +01:00
committed by GitHub
parent c1959259ce
commit 1ec1377c08
3 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -41,7 +41,7 @@ Channel::Channel(const QString &name, Type type)
Channel::~Channel()
{
auto *app = tryGetApp();
if (app)
if (app && this->anythingLogged_)
{
app->getChatLogger()->closeChannel(this->name_, this->platform_);
}
@@ -106,6 +106,7 @@ void Channel::addMessage(MessagePtr message, MessageContext context,
getApp()->getChatLogger()->addMessage(this->name_, message,
this->platform_,
this->getCurrentStreamID());
this->anythingLogged_ = true;
}
}
+1
View File
@@ -143,6 +143,7 @@ private:
const QString name_;
LimitedQueue<MessagePtr> messages_;
Type type_;
bool anythingLogged_ = false;
QTimer clearCompletionModelTimer_;
};